load_model calls from_pretrained with default or custom model path.
(model_path: str | None, expected_call_arg: str)
| 139 | ], |
| 140 | ) |
| 141 | def test_load_model(model_path: str | None, expected_call_arg: str) -> None: |
| 142 | """load_model calls from_pretrained with default or custom model path.""" |
| 143 | fake_model = MagicMock(spec=StaticModel) |
| 144 | with patch("semble.index.dense.StaticModel.from_pretrained", return_value=fake_model) as mock_fp: |
| 145 | result, _ = load_model(model_path) |
| 146 | mock_fp.assert_called_once_with(expected_call_arg, force_download=False) |
| 147 | assert result is fake_model |
| 148 | |
| 149 | |
| 150 | def test_embed_chunks_empty_returns_empty_array(mock_model: Any) -> None: |
nothing calls this directly
no test coverage detected