|
4 | 4 | AioHTTPTestCase, |
5 | 5 | unittest_run_loop, |
6 | 6 | ) |
| 7 | + |
7 | 8 | from minos.api_gateway.common import ( |
8 | 9 | MinosConfig, |
9 | 10 | ) |
10 | 11 | from minos.api_gateway.discovery import ( |
11 | 12 | DiscoveryService, |
12 | 13 | ) |
13 | | -from tests.test_api_gateway.test_discovery.dataset import generate_record, generate_random_microservice_names, \ |
14 | | - generate_record_old |
| 14 | +from tests.test_api_gateway.test_discovery.dataset import ( |
| 15 | + generate_random_microservice_names, |
| 16 | + generate_record, |
| 17 | + generate_record_old, |
| 18 | +) |
15 | 19 | from tests.utils import ( |
16 | 20 | BASE_PATH, |
17 | 21 | ) |
@@ -70,15 +74,16 @@ async def test_bulk_update(self): |
70 | 74 | # Check updated records are correct |
71 | 75 | for record in expected: |
72 | 76 | response = await self.client.get( |
73 | | - f"/microservices?verb={record['body']['endpoints'][0][0]}&path={record['body']['endpoints'][0][1]}") |
| 77 | + f"/microservices?verb={record['body']['endpoints'][0][0]}&path={record['body']['endpoints'][0][1]}" |
| 78 | + ) |
74 | 79 |
|
75 | 80 | self.assertEqual(200, response.status) |
76 | 81 |
|
77 | 82 | body = await response.json() |
78 | 83 |
|
79 | | - self.assertEqual(record['body']['address'], body["address"]) |
80 | | - self.assertEqual(record['body']['port'], int(body["port"])) |
81 | | - self.assertEqual(record['name'], body["name"]) |
| 84 | + self.assertEqual(record["body"]["address"], body["address"]) |
| 85 | + self.assertEqual(record["body"]["port"], int(body["port"])) |
| 86 | + self.assertEqual(record["name"], body["name"]) |
82 | 87 |
|
83 | 88 | async def test_bulk_update_2(self): |
84 | 89 | expected = list() |
@@ -106,15 +111,16 @@ async def test_bulk_update_2(self): |
106 | 111 |
|
107 | 112 | for record in expected: |
108 | 113 | response = await self.client.get( |
109 | | - f"/microservices?verb={record['body']['endpoints'][0][0]}&path={record['body']['endpoints'][0][1]}") |
| 114 | + f"/microservices?verb={record['body']['endpoints'][0][0]}&path={record['body']['endpoints'][0][1]}" |
| 115 | + ) |
110 | 116 |
|
111 | 117 | self.assertEqual(200, response.status) |
112 | 118 |
|
113 | 119 | body = await response.json() |
114 | 120 |
|
115 | | - self.assertEqual(record['body']['address'], body["address"]) |
116 | | - self.assertEqual(int(record['body']['port']), int(body["port"])) |
117 | | - self.assertEqual(record['name'], body["name"]) |
| 121 | + self.assertEqual(record["body"]["address"], body["address"]) |
| 122 | + self.assertEqual(int(record["body"]["port"]), int(body["port"])) |
| 123 | + self.assertEqual(record["name"], body["name"]) |
118 | 124 |
|
119 | 125 | @unittest_run_loop |
120 | 126 | async def test_post_missing_param(self): |
|
0 commit comments