Skip to content

Add utils tests #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
lcov.info

# Translations
*.mo
Expand Down
21 changes: 21 additions & 0 deletions gpm_api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ntpath as ntp
import gpm_api.configs
import os
from pytest_mock import MockerFixture
from unittest.mock import patch


Expand Down Expand Up @@ -385,3 +386,23 @@ def local_filepaths_windows(local_filepaths) -> List[str]:
"""Return the local filepath list as windows paths"""

return [ntp.join(*path) for path in local_filepaths]


@pytest.fixture
def set_is_orbit_to_true(
mocker: MockerFixture,
) -> None:
mocker.patch("gpm_api.checks.is_orbit", return_value=True)
mocker.patch("gpm_api.checks.is_grid", return_value=False)
mocker.patch("gpm_api.utils.checks.is_orbit", return_value=True)
mocker.patch("gpm_api.utils.checks.is_grid", return_value=False)


@pytest.fixture
def set_is_grid_to_true(
mocker: MockerFixture,
) -> None:
mocker.patch("gpm_api.checks.is_grid", return_value=True)
mocker.patch("gpm_api.checks.is_orbit", return_value=False)
mocker.patch("gpm_api.utils.checks.is_grid", return_value=True)
mocker.patch("gpm_api.utils.checks.is_orbit", return_value=False)
Loading