def test_export_host_confitem(self): host_dict = conf.hostsConf[u'testserver1'] host_dict['nagiosDirectives'] = {u"max_check_attempts": u"8", u"check_interval": u"2"} self.hostloader.load() ci = ConfItem.by_host_confitem_name(u"testserver1", u"max_check_attempts") self.assertNotEqual(ci, None, "confitem max_check_attempts must exist") self.assertEqual(ci.value, "8", "max_check_attempts=8") ci = ConfItem.by_host_confitem_name(u"testserver1", u"check_interval") self.assertNotEqual(ci, None, "confitem check_interval must exist") self.assertEquals(ci.value, "2", "check_interval=2")
def test_get_by_host_confitem_name(self): ob = ConfItem.by_host_confitem_name(u'myhost', self.attrs['name']) assert_equals('5', ob.value)