Skip to content

Commit

Permalink
Add online test for Time search parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
SolarDrew committed Feb 26, 2024
1 parent d172ba6 commit 761676d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions dkist/net/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ def test_search(client):
res = client.search(a.Time("2019/01/01", "2021/01/01"))


@pytest.mark.remote_data
def test_search_by_time(client):
# Test searching by a time range that overlaps the end of the dataset
res = client.search(a.Time("2022/12/27 19:55", "2022/12/27 20:01"), a.Instrument("VBI"))
assert len(res) == 1
assert res[0]["Primary Proposal ID"] == "pid_1_50"

# Test searching by a time range that overlaps the start of the dataset
res = client.search(a.Time("2022/12/27 19:26", "2022/12/27 19:30"), a.Instrument("VBI"))
assert len(res) == 1
assert res[0]["Primary Proposal ID"] == "pid_1_50"

# Test searching by a time range completely within the dataset
res = client.search(a.Time("2022/12/27 19:30", "2022/12/27 19:35"), a.Instrument("VBI"))
assert len(res) == 1
assert res[0]["Primary Proposal ID"] == "pid_1_50"

# Test searching by a time range that completely contains the dataset
res = client.search(a.Time("2022/12/27 19:26", "2022/12/27 20:01"), a.Instrument("VBI"))
assert len(res) == 1
assert res[0]["Primary Proposal ID"] == "pid_1_50"


@pytest.fixture
def empty_query_response():
return DKISTQueryResponseTable()
Expand Down

0 comments on commit 761676d

Please sign in to comment.