Skip to content

Fix ISO range parsing #1284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added 2 more test cases for extract_dates func
  • Loading branch information
dmytrotsko committed Sep 18, 2023
commit f5909269a30bf83946993c1eee316d5e7aaec724
6 changes: 6 additions & 0 deletions tests/server/test_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ def test_extract_dates(self):
with self.subTest("multiple param mixed iso"):
with app.test_request_context("/?s=2020-01-01&s=2020-01-02,2020-01-03"):
self.assertEqual(extract_dates("s"), [20200101, 20200102, 20200103])
with self.subTest("iso range"):
with app.test_request_context("/?s=2020-01-01--2020-01-30"):
self.assertEqual(extract_dates("s"), [(20200101, 20200130)])
with self.subTest("wildcard"):
with app.test_request_context("/?s=*"):
self.assertEqual(extract_dates("s"), ["*"])

with self.subTest("not a date"):
with app.test_request_context("/?s=a"):
Expand Down