Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhealy1 committed Apr 24, 2024
1 parent 499aa50 commit 05edbab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion stac_fastapi/types/tests/test_rfc3339.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from datetime import timezone

import pytest
from fastapi import HTTPException

from stac_fastapi.types.rfc3339 import (
now_in_utc,
Expand Down Expand Up @@ -86,8 +87,14 @@ def test_parse_valid_str_to_datetime(test_input):

@pytest.mark.parametrize("test_input", invalid_intervals)
def test_parse_invalid_interval_to_datetime(test_input):
with pytest.raises(ValueError):
with pytest.raises(HTTPException) as exc_info:
str_to_interval(test_input)
assert (
exc_info.value.status_code == 400
), "Should return a 400 status code for invalid intervals"
assert "Start datetime cannot be before end datetime." in str(
exc_info.value.detail
), "Error message does not match expected output"


@pytest.mark.parametrize("test_input", valid_intervals)
Expand Down

0 comments on commit 05edbab

Please sign in to comment.