From 75978b3cad20a8e2b6c1560146f02131f92284fc Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 19 Apr 2022 13:25:53 +0000 Subject: [PATCH] Restyled by black --- .../tests/test_kong/test_client.py | 17 ++++++------- .../tests/test_kong/test_discovery.py | 24 ++++++++++++++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/packages/plugins/minos-discovery-kong/tests/test_kong/test_client.py b/packages/plugins/minos-discovery-kong/tests/test_kong/test_client.py index 0541216e0..551f6257e 100644 --- a/packages/plugins/minos-discovery-kong/tests/test_kong/test_client.py +++ b/packages/plugins/minos-discovery-kong/tests/test_kong/test_client.py @@ -233,10 +233,11 @@ async def test_jwt_token_generation_with_expiration(self): async def test_token_decode(self): res = await self.kong.decode_token( "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ5ZTBRdURsNG03UW1qbnpFR0pJaUVyQnZieFBqSXM3VyIsImV4cCI6MTY1" - "MDM2NzE0NywibmJmIjoxNjUwMzY3MDI3fQ.SDH5Zq1mUSU0GkCyC_kF81_uoiF45u62Hgwnuv4wl5U") - self.assertIn('iss', res) - self.assertIn('exp', res) - self.assertIn('nbf', res) + "MDM2NzE0NywibmJmIjoxNjUwMzY3MDI3fQ.SDH5Zq1mUSU0GkCyC_kF81_uoiF45u62Hgwnuv4wl5U" + ) + self.assertIn("iss", res) + self.assertIn("exp", res) + self.assertIn("nbf", res) async def test_get_token_by_id(self): user_uuid = uuid4() @@ -255,12 +256,12 @@ async def test_get_token_by_id(self): self.assertGreater(len(token), 50) - response = await self.kong.get_jwt_by_id(resp['id']) + response = await self.kong.get_jwt_by_id(resp["id"]) self.assertTrue(200 == response.status_code) resp = response.json() - self.assertIn('key', resp) - self.assertIn('secret', resp) + self.assertIn("key", resp) + self.assertIn("secret", resp) async def test_get_consumer_jwts(self): user_uuid = uuid4() @@ -278,7 +279,7 @@ async def test_get_consumer_jwts(self): self.assertTrue(200 == response.status_code) resp = response.json() - self.assertEqual(len(resp['data']), 1) + self.assertEqual(len(resp["data"]), 1) class TestKongClientFromConfig(unittest.IsolatedAsyncioTestCase): diff --git a/packages/plugins/minos-discovery-kong/tests/test_kong/test_discovery.py b/packages/plugins/minos-discovery-kong/tests/test_kong/test_discovery.py index de05a0869..71d4c0381 100644 --- a/packages/plugins/minos-discovery-kong/tests/test_kong/test_discovery.py +++ b/packages/plugins/minos-discovery-kong/tests/test_kong/test_discovery.py @@ -87,9 +87,27 @@ async def test_subscribe_with_auth(self): 5660, name, [ - {"url": "/", "method": "GET", "authenticated": True, "authorized_groups": ["super_admin", "admin"], "regex_priority": 0}, - {"url": "/foo", "method": "POST", "authenticated": True, "authorized_groups": ["super_admin", "admin"], "regex_priority": 0}, - {"url": "/bar", "method": "GET", "authenticated": True, "authorized_groups": ["super_admin", "admin"], "regex_priority": 0}, + { + "url": "/", + "method": "GET", + "authenticated": True, + "authorized_groups": ["super_admin", "admin"], + "regex_priority": 0, + }, + { + "url": "/foo", + "method": "POST", + "authenticated": True, + "authorized_groups": ["super_admin", "admin"], + "regex_priority": 0, + }, + { + "url": "/bar", + "method": "GET", + "authenticated": True, + "authorized_groups": ["super_admin", "admin"], + "regex_priority": 0, + }, ], ) self.assertTrue(201 == response.status_code)