Skip to content

Commit

Permalink
Parametrize the test because that's how we do things
Browse files Browse the repository at this point in the history
  • Loading branch information
SolarDrew committed Feb 26, 2024
1 parent 49a1a19 commit 2b94b86
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dkist/net/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def test_search(client):


@pytest.mark.remote_data
def test_search_by_time(client):
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"))
@pytest.mark.parametrize("time", [
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
])
def test_search_by_time(client, time):
res = client.search(time, a.Instrument("VBI"))
assert len(res) == 1
assert res[0]["Primary Proposal ID"] == "pid_1_50"
assert res[0]["Start Time"].value == '2022-12-27T19:27:42.338' and res[0]["End Time"].value == '2022-12-27T20:00:09.005'
Expand Down

0 comments on commit 2b94b86

Please sign in to comment.