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)
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)
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)
def test__init(self): if Bcfg2.Options.setup.probes_db: TestPlugin.test__init(self)
def inner(): return TestPlugin.get_obj(self, core=core)
def test__init(self): TestPlugin.test__init(self) th = self.get_obj() self.assertIsInstance(th.helpers, HelperSet)
def inner(): obj = TestPlugin.get_obj(self, core=core) obj.config.data = config obj.config.Index() return obj