From e29664c8d8064f0aa850446a38382cf7f4ff0326 Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Fri, 8 Sep 2023 15:32:59 -0700 Subject: [PATCH] Try to fix race condition --- tests/test_api.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index f4bb1eb2..d1f44e21 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1726,8 +1726,13 @@ def test_followers(self): assert(result['followed']) result = self.sg.followers(self.shot) + + result = list(filter( + lambda c: c['type'] == 'HumanUser' and c['id'] == self.human_user['id'], + result, + )) + self.assertEqual(1, len(result)) - self.assertEqual(self.human_user['id'], result[0]['id']) def test_following(self): '''Test following method''' @@ -1740,8 +1745,13 @@ def test_following(self): assert(result['followed']) result = self.sg.following(self.human_user) + + result = list(filter( + lambda c: c['type'] == 'Shot' and c['id'] == self.shot['id'], + result, + )) + self.assertEqual(1, len(result)) - self.assertEqual(self.shot['id'], result[0]['id']) result = self.sg.follow(self.human_user, self.task) assert(result['followed'])