def test_add_host_fail(self): api = NetworkRunner() assert 'test' not in api.inventory.hosts with self.assertRaises(AssertionError): api.add_host(None)
def test_get_host_by_ansible_host(self): host = Host(name='test1', ansible_host='test2') api = NetworkRunner() api.add_host(host) ret = api.has_host('test2') self.assertTrue(ret)
def test_add_host(self): host = Host(name='test') api = NetworkRunner() assert 'test' not in api.inventory.hosts api.add_host(host) assert 'test' in api.inventory.hosts
def test_get_host_fail(self): host = Host(name='test1') api = NetworkRunner() api.add_host(host) ret = api.has_host('test') self.assertFalse(ret)