Exemplo n.º 1
0
    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()
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
def assert_parsed(data, parsed):
    # dump in json format for easily adding expected
    print(filedata.dumps(parsed))
    assert data.expected == parsed
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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