def test__set_info(self): @patch("Bcfg2.Server.Plugins.Cfg.CfgInfo._set_info") def inner(mock_set_info): ci = self.get_obj() entry = Mock() info = {"foo": "foo", "__children__": ["one", "two"]} ci._set_info(entry, info) self.assertItemsEqual(entry.append.call_args_list, [call(c) for c in info["__children__"]]) inner() TestCfgInfo.test__set_info(self)
def test__set_info(self): @patch("Bcfg2.Server.Plugins.Cfg.CfgInfo._set_info") def inner(mock_set_info): ci = self.get_obj() entry = Mock() info = {"foo": "foo", "__children__": ["one", "two"]} ci._set_info(entry, info) self.assertItemsEqual(entry.append.call_args_list, [call(c) for c in info['__children__']]) inner() TestCfgInfo.test__set_info(self)
def test__init(self): TestCfgInfo.test__init(self) ci = self.get_obj() self.assertIsInstance(ci.infoxml, InfoXML)
def setUp(self): TestCfgInfo.setUp(self) set_setup_default("filemonitor", MagicMock())