|
| 1 | +"""Tests for MiniMax model configuration.""" |
| 2 | + |
| 3 | +import importlib.util |
| 4 | +import os |
| 5 | +import sys |
| 6 | + |
| 7 | +import pytest |
| 8 | + |
| 9 | + |
| 10 | +@pytest.fixture(scope="module") |
| 11 | +def models_tokens(): |
| 12 | + """Import models_tokens directly to avoid triggering the full package init.""" |
| 13 | + spec = importlib.util.spec_from_file_location( |
| 14 | + "models_tokens", |
| 15 | + os.path.join( |
| 16 | + os.path.dirname(__file__), |
| 17 | + "..", |
| 18 | + "scrapegraphai", |
| 19 | + "helpers", |
| 20 | + "models_tokens.py", |
| 21 | + ), |
| 22 | + ) |
| 23 | + module = importlib.util.module_from_spec(spec) |
| 24 | + spec.loader.exec_module(module) |
| 25 | + return module.models_tokens |
| 26 | + |
| 27 | + |
| 28 | +def test_minimax_m27_in_model_list(models_tokens): |
| 29 | + """MiniMax-M2.7 and MiniMax-M2.7-highspeed should be in the model list.""" |
| 30 | + minimax_models = models_tokens["minimax"] |
| 31 | + assert "MiniMax-M2.7" in minimax_models |
| 32 | + assert "MiniMax-M2.7-highspeed" in minimax_models |
| 33 | + |
| 34 | + |
| 35 | +def test_minimax_m27_listed_first(models_tokens): |
| 36 | + """MiniMax-M2.7 should be the first model in the minimax dict.""" |
| 37 | + minimax_models = list(models_tokens["minimax"].keys()) |
| 38 | + assert minimax_models[0] == "MiniMax-M2.7" |
| 39 | + assert minimax_models[1] == "MiniMax-M2.7-highspeed" |
| 40 | + |
| 41 | + |
| 42 | +def test_minimax_old_models_still_present(models_tokens): |
| 43 | + """All previous MiniMax models should still be available.""" |
| 44 | + minimax_models = models_tokens["minimax"] |
| 45 | + assert "MiniMax-M2.5" in minimax_models |
| 46 | + assert "MiniMax-M2.5-highspeed" in minimax_models |
| 47 | + assert "MiniMax-M2" in minimax_models |
| 48 | + assert "MiniMax-M1" in minimax_models |
| 49 | + |
| 50 | + |
| 51 | +def test_minimax_m27_token_limits(models_tokens): |
| 52 | + """MiniMax-M2.7 models should have correct token limits.""" |
| 53 | + minimax_models = models_tokens["minimax"] |
| 54 | + assert minimax_models["MiniMax-M2.7"] == 204000 |
| 55 | + assert minimax_models["MiniMax-M2.7-highspeed"] == 204000 |
0 commit comments