Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 5
0
 def test__init(self):
     if Bcfg2.Options.setup.probes_db:
         TestPlugin.test__init(self)
Ejemplo n.º 6
0
 def test__init(self):
     if Bcfg2.Options.setup.probes_db:
         TestPlugin.test__init(self)
Ejemplo n.º 7
0
 def inner():
     return TestPlugin.get_obj(self, core=core)
Ejemplo n.º 8
0
    def test__init(self):
        TestPlugin.test__init(self)

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

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