We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1fc303 commit 01e2c7bCopy full SHA for 01e2c7b
tests/unit_test.py
@@ -0,0 +1,18 @@
1
+import json
2
+from server import loadCompetitions, app
3
+
4
5
+def test_loadCompetitions(tmpdir):
6
+ competitions = [
7
+ {"name": "Competition1", "numberOfPlaces": "15"},
8
+ {"name": "Competition2", "numberOfPlaces": "10"},
9
+ ]
10
+ competitions_file = tmpdir.join("test_competitions.json")
11
12
+ with open(competitions_file, "w") as f:
13
+ json.dump({"competitions": competitions}, f)
14
15
+ app.config["COMPETITIONS_FILE"] = str(competitions_file)
16
17
+ loaded_competitions = loadCompetitions()
18
+ assert loaded_competitions == competitions
0 commit comments