Skip to content

Commit 9173442

Browse files
committed
Fix failing CI tests
- Update CLI tests to use correct ModelRegistry patch path (app.ModelRegistry) - Add OMR_TEST_ALLOW_FAKE environment variable to ostruct test - All 169 tests now passing Fixes the 4 test failures from the GitHub Actions CI workflow.
1 parent 7c5be4a commit 9173442

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

tests/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_root_help_json(self, cli_runner: CliRunner) -> None:
8585
class TestProviderResolution:
8686
"""Test provider resolution precedence."""
8787

88-
@patch("openai_model_registry.cli.app.ModelRegistry")
88+
@patch("openai_model_registry.cli.app.app.ModelRegistry")
8989
def test_cli_flag_precedence(self, mock_registry_class: MagicMock, cli_runner: CliRunner) -> None:
9090
"""Test CLI flag takes precedence over environment."""
9191
mock_registry = Mock()
@@ -99,7 +99,7 @@ def test_cli_flag_precedence(self, mock_registry_class: MagicMock, cli_runner: C
9999
assert "azure" in result.output
100100
assert "CLI flag" in result.output
101101

102-
@patch("openai_model_registry.cli.app.ModelRegistry")
102+
@patch("openai_model_registry.cli.app.app.ModelRegistry")
103103
def test_env_var_precedence(self, mock_registry_class: MagicMock, cli_runner: CliRunner) -> None:
104104
"""Test environment variable precedence over default."""
105105
mock_registry = Mock()
@@ -113,7 +113,7 @@ def test_env_var_precedence(self, mock_registry_class: MagicMock, cli_runner: Cl
113113
assert "azure" in result.output
114114
assert "Environment variable" in result.output
115115

116-
@patch("openai_model_registry.cli.app.ModelRegistry")
116+
@patch("openai_model_registry.cli.app.app.ModelRegistry")
117117
def test_default_precedence(self, mock_registry_class: MagicMock, cli_runner: CliRunner) -> None:
118118
"""Test default provider when no CLI flag or env var."""
119119
mock_registry = Mock()

tests/test_fetch_pricing_ostruct.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class _Res: # minimal CompletedProcess stub
3535

3636

3737
@patch("subprocess.run", _fake_subprocess_run) # noqa: D401
38+
@patch.dict("os.environ", {"OMR_TEST_ALLOW_FAKE": "1"})
3839
def test_run_ostruct_mock(tmp_path: Path) -> None:
3940
"""Script returns dict and writes YAML deterministically."""
4041
# Ensure OUTPUT_DIR points to tmp

0 commit comments

Comments
 (0)