Skip to content

Commit 75978b3

Browse files
Restyled by black
1 parent 4c8ab90 commit 75978b3

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

packages/plugins/minos-discovery-kong/tests/test_kong/test_client.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,11 @@ async def test_jwt_token_generation_with_expiration(self):
233233
async def test_token_decode(self):
234234
res = await self.kong.decode_token(
235235
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ5ZTBRdURsNG03UW1qbnpFR0pJaUVyQnZieFBqSXM3VyIsImV4cCI6MTY1"
236-
"MDM2NzE0NywibmJmIjoxNjUwMzY3MDI3fQ.SDH5Zq1mUSU0GkCyC_kF81_uoiF45u62Hgwnuv4wl5U")
237-
self.assertIn('iss', res)
238-
self.assertIn('exp', res)
239-
self.assertIn('nbf', res)
236+
"MDM2NzE0NywibmJmIjoxNjUwMzY3MDI3fQ.SDH5Zq1mUSU0GkCyC_kF81_uoiF45u62Hgwnuv4wl5U"
237+
)
238+
self.assertIn("iss", res)
239+
self.assertIn("exp", res)
240+
self.assertIn("nbf", res)
240241

241242
async def test_get_token_by_id(self):
242243
user_uuid = uuid4()
@@ -255,12 +256,12 @@ async def test_get_token_by_id(self):
255256

256257
self.assertGreater(len(token), 50)
257258

258-
response = await self.kong.get_jwt_by_id(resp['id'])
259+
response = await self.kong.get_jwt_by_id(resp["id"])
259260
self.assertTrue(200 == response.status_code)
260261
resp = response.json()
261262

262-
self.assertIn('key', resp)
263-
self.assertIn('secret', resp)
263+
self.assertIn("key", resp)
264+
self.assertIn("secret", resp)
264265

265266
async def test_get_consumer_jwts(self):
266267
user_uuid = uuid4()
@@ -278,7 +279,7 @@ async def test_get_consumer_jwts(self):
278279
self.assertTrue(200 == response.status_code)
279280
resp = response.json()
280281

281-
self.assertEqual(len(resp['data']), 1)
282+
self.assertEqual(len(resp["data"]), 1)
282283

283284

284285
class TestKongClientFromConfig(unittest.IsolatedAsyncioTestCase):

packages/plugins/minos-discovery-kong/tests/test_kong/test_discovery.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,27 @@ async def test_subscribe_with_auth(self):
8787
5660,
8888
name,
8989
[
90-
{"url": "/", "method": "GET", "authenticated": True, "authorized_groups": ["super_admin", "admin"], "regex_priority": 0},
91-
{"url": "/foo", "method": "POST", "authenticated": True, "authorized_groups": ["super_admin", "admin"], "regex_priority": 0},
92-
{"url": "/bar", "method": "GET", "authenticated": True, "authorized_groups": ["super_admin", "admin"], "regex_priority": 0},
90+
{
91+
"url": "/",
92+
"method": "GET",
93+
"authenticated": True,
94+
"authorized_groups": ["super_admin", "admin"],
95+
"regex_priority": 0,
96+
},
97+
{
98+
"url": "/foo",
99+
"method": "POST",
100+
"authenticated": True,
101+
"authorized_groups": ["super_admin", "admin"],
102+
"regex_priority": 0,
103+
},
104+
{
105+
"url": "/bar",
106+
"method": "GET",
107+
"authenticated": True,
108+
"authorized_groups": ["super_admin", "admin"],
109+
"regex_priority": 0,
110+
},
93111
],
94112
)
95113
self.assertTrue(201 == response.status_code)

0 commit comments

Comments
 (0)