def test_bird_status(self): """Test that we can fetch the status & uptime info""" for expected in self.expected.get_bird_status(): status = self.pybird.get_bird_status() print(filedata.dumps(status)) assert expected == status assert not self.mock_bird.unused_tests()
def run_method_test(self, name, *args): func = getattr(self.pybird, name) if not func: raise ValueError("Method {} not found on pybird".format(name)) for expected in getattr(self.expected, name)(*args): result = func(*args) print(filedata.dumps(result)) assert expected == result
def assert_parsed(data, parsed): # dump in json format for easily adding expected print(filedata.dumps(parsed)) assert data.expected == parsed
def test_get_prefix_info(self): for expected in self.expected.get_prefix_info('8.8.8.8', 'peer'): status = self.pybird.get_prefix_info('8.8.8.8', 'peer') print(filedata.dumps(status)) assert expected == status
def test_get_peer_prefixes_exported(self): for expected in self.expected.get_peer_prefixes_exported('peer'): status = self.pybird.get_peer_prefixes_exported('peer') print(filedata.dumps(status)) assert expected == status