Skip to content

Commit

Permalink
Bit of tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
SolarDrew committed Feb 26, 2024
1 parent 761676d commit 15a15db
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions dkist/net/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,15 @@ def test_search(client):

@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"

for t in [
a.Time("2022/12/27 19:55", "2022/12/27 20:01"), # Time range overlaps the end of the dataset
a.Time("2022/12/27 19:26", "2022/12/27 19:30"), # Time range overlaps the start of the dataset
a.Time("2022/12/27 19:30", "2022/12/27 19:35"), # Time range within the dataset
a.Time("2022/12/27 19:26", "2022/12/27 20:01"), # Time range contains dataset
]:
res = client.search(t, a.Instrument("VBI"))
assert len(res) == 1
assert res[0]["Primary Proposal ID"] == "pid_1_50"

@pytest.fixture
def empty_query_response():
Expand Down

0 comments on commit 15a15db

Please sign in to comment.