示例#1
0
    def test__init(self):
        TestPlugin.test__init(self)

        core = Mock()
        p = self.get_obj(core=core)
        self.assertIsInstance(p.store, PropDirectoryBacked)
        self.assertEqual(Bcfg2.Server.Plugins.Properties.SETUP, core.setup)
示例#2
0
    def test__init(self):
        TestPlugin.test__init(self)

        core = Mock()
        p = self.get_obj(core=core)
        self.assertIsInstance(p.store, PropDirectoryBacked)
        self.assertEqual(Bcfg2.Server.Plugins.Properties.SETUP, core.setup)
示例#3
0
 def get_obj(self):
     if not Bcfg2.Options.setup.probes_db:
         # actually use a real datastore so we can read and write
         # probed.xml
         if self.datastore is None:
             self.datastore = tempfile.mkdtemp()
             Bcfg2.Options.setup.repository = self.datastore
             datadir = os.path.join(self.datastore, self.test_obj.name)
             if not os.path.exists(datadir):
                 os.makedirs(datadir)
     return TestPlugin.get_obj(self)
示例#4
0
 def get_obj(self, core=None):
     if not Bcfg2.Options.setup.probes_db:
         # actually use a real datastore so we can read and write
         # probed.xml
         if self.datastore is None:
             self.datastore = tempfile.mkdtemp()
             Bcfg2.Options.setup.repository = self.datastore
             datadir = os.path.join(self.datastore, self.test_obj.name)
             if not os.path.exists(datadir):
                 os.makedirs(datadir)
     return TestPlugin.get_obj(self, core)
示例#5
0
 def test__init(self):
     if Bcfg2.Options.setup.probes_db:
         TestPlugin.test__init(self)
示例#6
0
 def test__init(self):
     if Bcfg2.Options.setup.probes_db:
         TestPlugin.test__init(self)
示例#7
0
 def inner():
     return TestPlugin.get_obj(self, core=core)
示例#8
0
    def test__init(self):
        TestPlugin.test__init(self)

        th = self.get_obj()
        self.assertIsInstance(th.helpers, HelperSet)
示例#9
0
 def inner():
     obj = TestPlugin.get_obj(self, core=core)
     obj.config.data = config
     obj.config.Index()
     return obj
示例#10
0
    def test__init(self):
        TestPlugin.test__init(self)

        th = self.get_obj()
        self.assertIsInstance(th.helpers, HelperSet)