Skip to content

Commit c6056e0

Browse files
author
matthias_schaub
committed
Wait for Firebase Functions to complete during test setup.
1 parent 22e47c0 commit c6056e0

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

mapswipe_workers/tests/integration/test_transfer_results.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ def test_changes_given_project_id(self):
2626

2727
pg_db = auth.postgresDB()
2828
sql_query = (
29-
"SELECT * FROM results WHERE project_id = '{0}' AND user_id = '{0}'".format(
30-
self.project_id
31-
)
29+
f"SELECT * "
30+
f"FROM results "
31+
f"WHERE project_id = '{self.project_id}' "
32+
f"AND user_id = '{self.project_id}'"
3233
)
3334
result = pg_db.retr_query(sql_query)
3435
self.assertIsNotNone(result)
@@ -43,9 +44,10 @@ def test_changes(self):
4344

4445
pg_db = auth.postgresDB()
4546
sql_query = (
46-
"SELECT * FROM results WHERE project_id = '{0}' and user_id = '{0}'".format(
47-
self.project_id
48-
)
47+
f"SELECT * "
48+
f"FROM results "
49+
f"WHERE project_id = '{self.project_id}' "
50+
f"AND user_id = '{self.project_id}'"
4951
)
5052
result = pg_db.retr_query(sql_query)
5153
self.assertIsNotNone(result)
@@ -56,9 +58,9 @@ def test_user_not_in_postgres(self):
5658

5759
# Make sure user and results are not yet in Postgres
5860
sql_query = (
59-
"DELETE FROM results WHERE user_id = '{0}' and project_id = '{0}'".format(
60-
self.project_id
61-
)
61+
f"DELETE FROM results "
62+
f"WHERE user_id = '{self.project_id}' "
63+
f"AND project_id = '{self.project_id}'"
6264
)
6365
pg_db.query(sql_query)
6466
sql_query = "DELETE FROM users WHERE user_id = '{0}'".format(self.project_id)
@@ -71,9 +73,10 @@ def test_user_not_in_postgres(self):
7173
self.assertIsNotNone(result)
7274

7375
sql_query = (
74-
"SELECT * FROM results WHERE project_id = '{0}' AND user_id = '{0}'".format(
75-
self.project_id
76-
)
76+
f"SELECT * "
77+
f"FROM results "
78+
f"WHERE project_id = '{self.project_id}' "
79+
f"AND user_id = '{self.project_id}'"
7780
)
7881
result = pg_db.retr_query(sql_query)
7982
self.assertIsNotNone(result)

mapswipe_workers/tests/unittests/test_user_stats.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
import pandas as pd
55
from pandas.testing import assert_frame_equal
66

7-
from mapswipe_workers.generate_stats.user_stats import (
8-
get_agg_results_by_user_id,
9-
)
7+
from mapswipe_workers.generate_stats.user_stats import get_agg_results_by_user_id
108

119

1210
class TestUserStats(unittest.TestCase):

0 commit comments

Comments
 (0)