Skip to content

Commit 6667bfe

Browse files
author
matthias_schaub
committed
Wait until Firebase Functions complete befor testing.
1 parent b789d4c commit 6667bfe

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# python -m unittest test_create_project.py
1+
python -m unittest test_create_project.py
22
python -m unittest test_archive_project.py
33
python -m unittest test_delete_project.py
44
python -m unittest test_update_user_data.py
55
python -m unittest test_transfer_results.py
66
python -m unittest test_gdal.py
7+
python -m unittest test_team_management.py

mapswipe_workers/tests/integration/test_archive_project.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import time
12
import unittest
23

34
import set_up
@@ -12,13 +13,15 @@ def setUp(self):
1213
self.project_id = set_up.create_test_project(
1314
"tile_map_service_grid", "build_area", results=True
1415
)
16+
time.sleep(2) # Wait for Firebase Functions to complete
1517

1618
def tearDown(self):
1719
tear_down.delete_test_data(self.project_id)
1820

1921
def test_changes(self):
2022
"""Test if groups, tasks and results are deleted from Firebase."""
2123
archive_project.archive_project([self.project_id])
24+
time.sleep(2) # Wait for Firebase Functions to complete
2225

2326
fb_db = auth.firebaseDB()
2427
ref = fb_db.reference("v2/groups/{0}".format(self.project_id))
@@ -40,6 +43,7 @@ def test_changes(self):
4043
def test_project_id_not_exists(self):
4144
"""Test for project id which does not exists."""
4245
archive_project.archive_project(["tuna"])
46+
time.sleep(2) # Wait for Firebase Functions to complete
4347

4448
fb_db = auth.firebaseDB()
4549
ref = fb_db.reference("v2/groups/")

mapswipe_workers/tests/integration/test_delete_project.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ def setUp(self):
1414
self.project_id = set_up.create_test_project(
1515
"tile_map_service_grid", "build_area", results=True
1616
)
17+
time.sleep(2) # Wait for Firebase Functions to complete
1718

1819
def tearDown(self):
1920
tear_down.delete_test_data(self.project_id)
2021

2122
def test_deletion(self):
2223
"""Test if tasks, groups, project and results are deleted."""
2324
delete_project.delete_project([self.project_id])
24-
time.sleep(3)
25+
time.sleep(2) # Wait for Firebase Functions to complete
2526

2627
fb_db = auth.firebaseDB()
2728
ref = fb_db.reference("v2/results/{0}".format(self.project_id))
@@ -58,6 +59,7 @@ def test_deletion(self):
5859
def test_project_id_not_exists(self):
5960
"""Test for project id which does not exists."""
6061
delete_project.delete_project(["tuna"])
62+
time.sleep(2) # Wait for Firebase Functions to complete
6163

6264
fb_db = auth.firebaseDB()
6365
ref = fb_db.reference("v2/results")
@@ -94,6 +96,7 @@ def test_project_id_not_exists(self):
9496
def test_project_id_equals_none(self):
9597
"""Test for project id which does not exists."""
9698
delete_project.delete_project([None])
99+
time.sleep(2) # Wait for Firebase Functions to complete
97100

98101
fb_db = auth.firebaseDB()
99102
ref = fb_db.reference("v2/results")

0 commit comments

Comments
 (0)