Skip to content

Commit

Permalink
Add Feature toggle test + Change value (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
timvanoostrom authored Nov 20, 2023
1 parent e1d0275 commit 03788a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
ZORGNED_GEMEENTE_CODE = "0363"
ZORGNED_API_TOKEN = os.getenv("ZORGNED_API_TOKEN", os.getenv("WMO_NED_API_TOKEN"))
ZORGNED_API_URL = os.getenv("ZORGNED_API_URL")
ZORGNED_DOCUMENT_ATTACHMENTS_ACTIVE = True
ZORGNED_DOCUMENT_ATTACHMENTS_ACTIVE = False

WMONED_FERNET_ENCRYPTION_KEY = os.getenv("FERNET_KEY")

Expand Down
31 changes: 15 additions & 16 deletions app/test_zorgned_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ def test_format_aanvragen(self, encrypt_mock):

source1_formatted = format_aanvragen(source1)

document = {
"id": id_encrypted_mock,
"title": "WRV rapport",
"url": f"/wmoned/document/{id_encrypted_mock}",
"datePublished": "2021-03-31T15:28:05",
}

aanvraag1 = {
"title": "autozitje",
"itemTypeCode": "OVE",
Expand All @@ -341,14 +348,7 @@ def test_format_aanvragen(self, encrypt_mock):
"serviceOrderDate": "2017-05-01",
"serviceDateStart": "2017-06-01",
"serviceDateEnd": "2018-02-23",
"documents": [
{
"id": id_encrypted_mock,
"title": "WRV rapport",
"url": f"/wmoned/document/{id_encrypted_mock}",
"datePublished": "2021-03-31T15:28:05",
}
],
"documents": None,
}

aanvraag2 = {
Expand All @@ -363,16 +363,15 @@ def test_format_aanvragen(self, encrypt_mock):
"serviceOrderDate": "2017-05-01",
"serviceDateStart": "2017-06-01",
"serviceDateEnd": "2018-02-23",
"documents": [
{
"id": id_encrypted_mock,
"title": "WRV rapport",
"url": f"/wmoned/document/{id_encrypted_mock}",
"datePublished": "2021-03-31T15:28:05",
}
],
"documents": None,
}

self.maxDiff = None

if config.ZORGNED_DOCUMENT_ATTACHMENTS_ACTIVE:
aanvraag1["documents"] = [document]
aanvraag2["documents"] = [document]

self.assertEqual(len(source1_formatted), 2)
self.assertEqual(source1_formatted, [aanvraag1, aanvraag2])

Expand Down

0 comments on commit 03788a6

Please sign in to comment.