-
Notifications
You must be signed in to change notification settings - Fork 8
99 datetimeinterval RFC 3339 #100
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
bf76aad
bfdd154
11b9fc6
d44efe0
a2dbc44
02255ad
8481b6c
d46641e
3b2d167
9c212cb
a97129d
7d245a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from stapi_pydantic import DatetimeInterval | ||
|
|
||
|
|
||
| def test_datetime_interval() -> None: | ||
| """Test the datetime interval validator.""" | ||
| dt1 = DatetimeInterval.__metadata__[0].func("2025-04-01T00:00:00Z/2025-04-01T23:59:59Z") | ||
| dt2 = DatetimeInterval.__metadata__[0].func("2025-04-01T00:00:00Z/..") | ||
| dt3 = DatetimeInterval.__metadata__[0].func("../2025-04-01T23:59:59Z") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like your code would support this, but I would also explicitly test the case of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. Also, added unit test for end before start. |
||
| _ = DatetimeInterval.__metadata__[1].func(dt1) | ||
| _ = DatetimeInterval.__metadata__[1].func(dt2) | ||
| _ = DatetimeInterval.__metadata__[1].func(dt3) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: one of the intervals has to closed, e.g.,
../..and/are not allowed. The code from stac-server (that I believe to be correct) is: