From 0add5777c82a850a08ebe108788773987455fab8 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Tue, 15 Aug 2023 00:58:31 -0500 Subject: [PATCH] Update test_asyncify.py --- auth0/test_async/test_asyncify.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/auth0/test_async/test_asyncify.py b/auth0/test_async/test_asyncify.py index 5501644e..84200d29 100644 --- a/auth0/test_async/test_asyncify.py +++ b/auth0/test_async/test_asyncify.py @@ -63,7 +63,7 @@ class TestAsyncify(getattr(unittest, "IsolatedAsyncioTestCase", object)): @aioresponses() async def test_get(self, mocked): callback, mock = get_callback() - mocked.get(clients, callback=callback) + await mocked.get(clients, callback=callback) c = asyncify(Clients)(domain="example.com", token="jwt") self.assertEqual(await c.all_async(), payload) mock.assert_called_with( @@ -78,7 +78,7 @@ async def test_get(self, mocked): @aioresponses() async def test_post(self, mocked): callback, mock = get_callback() - mocked.post(clients, callback=callback) + await mocked.post(clients, callback=callback) c = asyncify(Clients)(domain="example.com", token="jwt") data = {"client": 1} self.assertEqual(await c.create_async(data), payload) @@ -94,7 +94,7 @@ async def test_post(self, mocked): @aioresponses() async def test_post_auth(self, mocked): callback, mock = get_callback() - mocked.post(token, callback=callback) + await mocked.post(token, callback=callback) c = asyncify(GetToken)("example.com", "cid", client_secret="clsec") self.assertEqual( await c.login_async(username="usrnm", password="pswd"), payload @@ -120,7 +120,7 @@ async def test_post_auth(self, mocked): @aioresponses() async def test_user_info(self, mocked): callback, mock = get_callback() - mocked.get(user_info, callback=callback) + await mocked.get(user_info, callback=callback) c = asyncify(Users)(domain="example.com") self.assertEqual( await c.userinfo_async(access_token="access-token-example"), payload @@ -137,7 +137,7 @@ async def test_user_info(self, mocked): @aioresponses() async def test_file_post(self, mocked): callback, mock = get_callback() - mocked.post(users_imports, callback=callback) + await mocked.post(users_imports, callback=callback) j = asyncify(Jobs)(domain="example.com", token="jwt") users = TemporaryFile() self.assertEqual(await j.import_users_async("connection-1", users), payload) @@ -162,7 +162,7 @@ async def test_file_post(self, mocked): @aioresponses() async def test_patch(self, mocked): callback, mock = get_callback() - mocked.patch(clients, callback=callback) + await mocked.patch(clients, callback=callback) c = asyncify(Clients)(domain="example.com", token="jwt") data = {"client": 1} self.assertEqual(await c.update_async("client-1", data), payload) @@ -178,7 +178,7 @@ async def test_patch(self, mocked): @aioresponses() async def test_put(self, mocked): callback, mock = get_callback() - mocked.put(factors, callback=callback) + await mocked.put(factors, callback=callback) g = asyncify(Guardian)(domain="example.com", token="jwt") data = {"factor": 1} self.assertEqual(await g.update_factor_async("factor-1", data), payload) @@ -194,7 +194,7 @@ async def test_put(self, mocked): @aioresponses() async def test_delete(self, mocked): callback, mock = get_callback() - mocked.delete(clients, callback=callback) + await mocked.delete(clients, callback=callback) c = asyncify(Clients)(domain="example.com", token="jwt") self.assertEqual(await c.delete_async("client-1"), payload) mock.assert_called_with( @@ -210,7 +210,7 @@ async def test_delete(self, mocked): @aioresponses() async def test_shared_session(self, mocked): callback, mock = get_callback() - mocked.get(clients, callback=callback) + await mocked.get(clients, callback=callback) async with asyncify(Clients)(domain="example.com", token="jwt") as c: self.assertEqual(await c.all_async(), payload) mock.assert_called_with( @@ -225,10 +225,10 @@ async def test_shared_session(self, mocked): @aioresponses() async def test_rate_limit(self, mocked): callback, mock = get_callback(status=429) - mocked.get(clients, callback=callback) - mocked.get(clients, callback=callback) - mocked.get(clients, callback=callback) - mocked.get(clients, payload=payload) + await mocked.get(clients, callback=callback) + await mocked.get(clients, callback=callback) + await mocked.get(clients, callback=callback) + await mocked.get(clients, payload=payload) c = asyncify(Clients)(domain="example.com", token="jwt") rest_client = c._async_client.client rest_client._skip_sleep = True @@ -241,7 +241,7 @@ async def test_rate_limit(self, mocked): @aioresponses() async def test_timeout(self, mocked): callback, mock = get_callback() - mocked.get(clients, callback=callback) + await mocked.get(clients, callback=callback) c = asyncify(Clients)(domain="example.com", token="jwt", timeout=(8.8, 9.9)) self.assertEqual(await c.all_async(), payload) mock.assert_called_with(