Skip to content

Commit 5fa9c6b

Browse files
committed
Update tests.py
add test for get documents by type
1 parent fda9d50 commit 5fa9c6b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/tests.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ def test_get_documents_by_date(start = "2024-01-01", end = "2024-01-31"):
228228
assert count == len(results)
229229

230230

231+
def test_get_documents_by_date_types(start = "2024-01-01", end = "2024-01-31", types = ["RULE", "PRORULE"]):
232+
results, count = get_documents_by_date(start, end, document_types=types)
233+
assert isinstance(results, list)
234+
assert count == len(results)
235+
res_types = set(doc.get("type") for doc in results)
236+
assert len(res_types) <= len(types)
237+
assert all(1 if t in types else 0 for t in res_types)
238+
239+
231240
def test_get_documents_by_number(numbers = ["2024-02204", "2023-28203", "2023-25797"]):
232241
results, count = get_documents_by_number(numbers)
233242
assert isinstance(results, list)

0 commit comments

Comments
 (0)