Skip to content

Commit

Permalink
run black #2714
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Jul 19, 2022
1 parent d6dc08a commit 4a1cc11
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

Case = None


def case_observer(cls):
global Case
Case = cls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@

Case = None


def case_observer(cls):
global Case
Case = cls


class MongoStore:
"""A line list store backed by mongodb."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from data_service import app
from data_service.main import set_up_controllers


@pytest.fixture
def client_with_patched_mongo(monkeypatch):
# configure controllers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from tests.end_to_end_fixture import client_with_patched_mongo


def test_adding_field_then_downloading_case(client_with_patched_mongo):
response = client_with_patched_mongo.post(
"/api/schema",
Expand All @@ -19,21 +20,20 @@ def test_adding_field_then_downloading_case(client_with_patched_mongo):
"confirmationDate": "2022-06-01T00:00:00.000Z",
"caseReference": {
"status": "UNVERIFIED",
"sourceId": "24680135792468013579fedc"
"sourceId": "24680135792468013579fedc",
},
"mySymptoms": "coughs, sneezles"
"mySymptoms": "coughs, sneezles",
},
)
assert response.status_code == 201
response = client_with_patched_mongo.get(
"/api/cases"
)
response = client_with_patched_mongo.get("/api/cases")
assert response.status_code == 200
case_list = response.get_json()
assert case_list["total"] == 1
assert len(case_list["cases"]) == 1
assert case_list["cases"][0]["mySymptoms"] == "coughs, sneezles"


def test_adding_field_then_downloading_csv(client_with_patched_mongo):
response = client_with_patched_mongo.post(
"/api/schema",
Expand All @@ -50,21 +50,19 @@ def test_adding_field_then_downloading_csv(client_with_patched_mongo):
"confirmationDate": "2022-06-01T00:00:00.000Z",
"caseReference": {
"status": "UNVERIFIED",
"sourceId": "24680135792468013579fedc"
"sourceId": "24680135792468013579fedc",
},
"someField": "well, what have we here"
"someField": "well, what have we here",
},
)
assert response.status_code == 201
response = client_with_patched_mongo.post(
"/api/cases/download", json = {
"format": "csv"
}
"/api/cases/download", json={"format": "csv"}
)
assert response.status_code == 200
csv_file = io.StringIO(response.get_data().decode("utf-8"))
csv_reader = csv.DictReader(csv_file)
cases = [c for c in csv_reader]
assert len(cases) == 1
case = cases[0]
assert case['someField'] == 'well, what have we here'
assert case["someField"] == "well, what have we here"

0 comments on commit 4a1cc11

Please sign in to comment.