Skip to content

Commit

Permalink
increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Feb 1, 2024
1 parent c575228 commit 627c20c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
- name: Full Tests
shell: bash -l {0}
run: |
python -m pytest -rxs --cov=gliderpy tests
python -m pytest -rxs --cov=gliderpy --vcr-record=none tests
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pytest
pytest-cov
pytest-flake8
pytest-sugar
pytest-vcr
pytest-xdist
setuptools_scm
sphinx
16 changes: 11 additions & 5 deletions tests/test_fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ def glider_grab():
yield 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()


def test_variables(glider_grab):
expected = [
"latitude",
Expand All @@ -25,10 +33,8 @@ def test_variables(glider_grab):
assert sorted(glider_grab.fetcher.variables) == sorted(expected)


def test_standardise_variables_ioos():
glider_grab = GliderDataFetcher()
glider_grab.fetcher.dataset_id = "whoi_406-20160902T1700"
df = glider_grab.to_pandas()
variables = df.columns
@pytest.mark.vcr(pandas_dataset)
def test_standardise_variables():
variables = pandas_dataset.columns
for var in variables:
assert var in server_parameter_rename.values()

0 comments on commit 627c20c

Please sign in to comment.