Skip to content

Commit

Permalink
refactor fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Jun 12, 2024
1 parent da14c26 commit 7d692a1
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions tests/test_fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@
def glider_grab():
"""Create the basic query object for testing."""
g = GliderDataFetcher()
g.dataset_id = "whoi_406-20160902T1700"
return g


@pytest.fixture
@pytest.mark.web
def pandas_dataset():
glider_grab = GliderDataFetcher()
glider_grab.fetcher.dataset_id = "whoi_406-20160902T1700"
yield glider_grab.to_pandas()
g.fetcher.dataset_id = "whoi_406-20160902T1700"
return g, g.to_pandas()


def test_variables(glider_grab):
Expand All @@ -34,12 +26,13 @@ def test_variables(glider_grab):
"temperature",
"time",
]
assert sorted(glider_grab.fetcher.variables) == sorted(expected)
g, df = glider_grab
assert sorted(g.fetcher.variables) == sorted(expected)


@pytest.mark.vcr()
def test_standardise_variables(pandas_dataset):
def test_standardise_variables(glider_grab):
"""Check if IOOS variables are properly renamed."""
variables = pandas_dataset.columns
g, df = glider_grab
variables = df.columns
for var in variables:
assert var in server_parameter_rename.values()

0 comments on commit 7d692a1

Please sign in to comment.