Skip to content

Commit

Permalink
revert init message, add fixtures dir
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-zhng committed Aug 5, 2024
1 parent e436413 commit 1895d21
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion stac_mjx/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""init file."""
"""This module exposes all high level APIs for stac-mjx."""
23 changes: 23 additions & 0 deletions tests/fixtures/configs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pytest
from unittest.mock import Mock
from omegaconf import OmegaConf
from stac_mjx import utils


@pytest.fixture
def mock_omegaconf_load(monkeypatch):
mock = Mock(
side_effect=[
OmegaConf.create({"model": "config"}),
OmegaConf.create({"stac": "config"}),
]
)
monkeypatch.setattr(OmegaConf, "load", mock)
return mock


@pytest.fixture
def mock_init_params(monkeypatch):
mock = Mock()
monkeypatch.setattr(utils, "init_params", mock)
return mock
23 changes: 1 addition & 22 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
import pytest
from unittest.mock import Mock
from omegaconf import OmegaConf, DictConfig
from stac_mjx import utils
from stac_mjx import main


@pytest.fixture
def mock_omegaconf_load(monkeypatch):
mock = Mock(
side_effect=[
OmegaConf.create({"model": "config"}),
OmegaConf.create({"stac": "config"}),
]
)
monkeypatch.setattr(OmegaConf, "load", mock)
return mock


@pytest.fixture
def mock_init_params(monkeypatch):
mock = Mock()
monkeypatch.setattr(utils, "init_params", mock)
return mock
from tests.fixtures.configs import mock_omegaconf_load, mock_init_params


def test_load_configs(mock_omegaconf_load, mock_init_params):
Expand Down

0 comments on commit 1895d21

Please sign in to comment.