server/test/unittest_serverctl.py
changeset 10960 9e64fddebc89
parent 10825 56ca5f6e0533
equal deleted inserted replaced
10956:208c9ac8edbb 10960:9e64fddebc89
     1 import os.path as osp
     1 import os.path as osp
     2 import shutil
     2 import shutil
     3 
     3 
     4 from cubicweb.devtools import testlib
     4 from cubicweb.devtools import testlib, ApptestConfiguration
     5 from cubicweb.server.serverctl import _local_dump, DBDumpCommand
     5 from cubicweb.server.serverctl import _local_dump, DBDumpCommand
     6 from cubicweb.server.serverconfig import ServerConfiguration
     6 from cubicweb.server.serverconfig import ServerConfiguration
     7 
     7 
     8 class ServerCTLTC(testlib.CubicWebTC):
     8 class ServerCTLTC(testlib.CubicWebTC):
     9     def setUp(self):
     9     def setUp(self):
    10         super(ServerCTLTC, self).setUp()
    10         super(ServerCTLTC, self).setUp()
    11         self.orig_config_for = ServerConfiguration.config_for
    11         self.orig_config_for = ServerConfiguration.config_for
    12         ServerConfiguration.config_for = staticmethod(lambda appid: self.config)
    12         config_for = lambda appid: ApptestConfiguration(appid, apphome=self.datadir)
       
    13         ServerConfiguration.config_for = staticmethod(config_for)
    13 
    14 
    14     def tearDown(self):
    15     def tearDown(self):
    15         ServerConfiguration.config_for = self.orig_config_for
    16         ServerConfiguration.config_for = self.orig_config_for
    16         super(ServerCTLTC, self).tearDown()
    17         super(ServerCTLTC, self).tearDown()
    17 
    18