Пример #1
0
 def setUpTestData(cls):
     cls.bgp_neighbors_detail = json_file_to_python_type(
         "peering/tests/fixtures/get_bgp_neighbors_detail.json"
     )
     cls.router = Router.objects.create(
         name="Test", hostname="test.example.com", platform=PLATFORM_JUNOS
     )
Пример #2
0
 def test_poll(self):
     with patch(
             "peering.models.Router.get_bgp_neighbors_detail",
             return_value=self.router.find_bgp_neighbor_detail(
                 json_file_to_python_type(
                     "peering/tests/fixtures/get_bgp_neighbors_detail.json"
                 ),
                 "2001:db8::1",
             ),
     ):
         self.assertTrue(self.session.poll())
         self.assertEqual(567_257, self.session.received_prefix_count)
Пример #3
0
 def setUpTestData(cls):
     cls.local_as = AutonomousSystem.objects.create(
         asn=64500,
         name="Autonomous System",
         affiliated=True,
     )
     cls.bgp_neighbors_detail = json_file_to_python_type(
         "peering/tests/fixtures/get_bgp_neighbors_detail.json")
     cls.router = Router.objects.create(
         name="Test",
         hostname="test.example.com",
         device_state=DeviceState.ENABLED,
         local_autonomous_system=cls.local_as,
     )
Пример #4
0
 def setUpTestData(cls):
     cls.bgp_neighbors_detail = json_file_to_python_type(
         "peering/tests/fixtures/get_bgp_neighbors_detail.json")