Skip to content

Commit 8810c7b

Browse files
committed
Add unit test for add_file_tasks_to_challenge
1 parent 938cf26 commit 8810c7b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/test_challenge_api.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ def test_add_tasks_to_challenge(self, mock_request, api_instance=api):
5757
json=test_geojson,
5858
params=None)
5959

60+
@patch('maproulette.api.maproulette_server.requests.Session.put')
61+
def test_add_file_tasks_to_challenge(self, mock_request, api_instance=api):
62+
test_challenge_id = '12978'
63+
data = {'json': ('data', test_geojson)}
64+
query_params = {
65+
"lineByLine": "true",
66+
"removeUnmatched": "false",
67+
"dataOriginDate": "",
68+
"skipSnapshot": "false"
69+
}
70+
api_instance.add_file_tasks_to_challenge(test_geojson, test_challenge_id)
71+
mock_request.assert_called_once_with(
72+
f'{self.url}/challenge/12978/addFileTasks',
73+
files=data,
74+
params=query_params)
75+
6076
@patch('maproulette.api.maproulette_server.requests.Session.post')
6177
def test_create_virtual_challenge(self, mock_request, api_instance=api):
6278
# TODO: add model for virtual challenge to aid in posting

0 commit comments

Comments
 (0)