From 007d2bff120366404d6f066077aa2e05f1d104a7 Mon Sep 17 00:00:00 2001 From: Yufeng Xin Date: Mon, 19 Aug 2024 23:08:59 -0400 Subject: [PATCH] connectionv2 --- sdx_controller/test/test_l2vpn_controller.py | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sdx_controller/test/test_l2vpn_controller.py b/sdx_controller/test/test_l2vpn_controller.py index 16d0968..5d83784 100644 --- a/sdx_controller/test/test_l2vpn_controller.py +++ b/sdx_controller/test/test_l2vpn_controller.py @@ -121,6 +121,27 @@ def test_place_connection_no_topology(self): # ingress port data, etc., for example. self.assertStatus(response, 400) + def test_place_connection_v2_no_topology(self): + """ + Test case for place_connection. + + Place a connection request with no topology present. + """ + body = ConnectionV2() + + response = self.client.open( + f"{BASE_PATH}/l2vpn", + method="POST", + data=json.dumps(body), + content_type="application/json", + ) + print(f"Response body is : {response.data.decode('utf-8')}") + + # Expect 400 failure because the request is incomplete: the + # bare minimum connection request we sent does not have + # ingress port data, etc., for example. + self.assertStatus(response, 400) + def __test_with_one_topology(self, topology_file): """ A helper method to test place_connection() with just one topology.