Skip to content

Commit 496f148

Browse files
committed
Unit tests: use ssertDictEqual for checking dictionaries
1 parent 8f7add4 commit 496f148

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

datarequest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def type_get(ctx: rule.Context, request_id: str) -> type:
283283
return datarequest_type
284284

285285

286-
def available_documents_get(ctx: rule.Context, request_id: str, datarequest_type: str, datarequest_status: str) -> List:
286+
def available_documents_get(ctx: rule.Context, request_id: str, datarequest_type: str, datarequest_status: str) -> list:
287287
# Construct list of existing documents
288288
available_documents = []
289289
if datarequest_type == type.REGULAR.value:
@@ -1195,7 +1195,7 @@ def api_datarequest_attachments_get(ctx: rule.Context, request_id: str) -> api.R
11951195
return attachments
11961196

11971197

1198-
def datarequest_attachments_get(ctx: rule.Context, request_id: str) -> Optional[List[str]]:
1198+
def datarequest_attachments_get(ctx: rule.Context, request_id: str) -> Optional[list[str]]:
11991199
"""Get all attachments of a given data request.
12001200
12011201
:param ctx: Combined type of a callback and rei struct

unit-tests/test_util_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def f(ctx, name: str, age: int):
9797
result = wrapped(DummyContext(), encode_input({'name': 'Yoda', 'age': 900}))
9898

9999
self.assertEqual(result['status'], 'ok')
100-
self.assertEqual(result['data'], {'name': 'Yoda', 'age': 900})
100+
self.assertDictEqual(result['data'], {'name': 'Yoda', 'age': 900})
101101

102102
def test_api_wrapper_accepts_int_for_float_argument(self):
103103
# JSON has no distinct integer/float types, so a `float`-annotated
@@ -130,7 +130,7 @@ def f(ctx, anything):
130130
result = wrapped(DummyContext(), encode_input({'anything': {'nested': [1, 2, 3]}}))
131131

132132
self.assertEqual(result['status'], 'ok')
133-
self.assertEqual(result['data'], {'nested': [1, 2, 3]})
133+
self.assertDictEqual(result['data'], {'nested': [1, 2, 3]})
134134

135135
def test_api_wrapper_reports_missing_required_argument(self):
136136
def f(ctx, name: str, age: int):

0 commit comments

Comments
 (0)