|
| 1 | +"""Tests for experimental features API.""" |
| 2 | + |
| 3 | +import pytest |
| 4 | + |
| 5 | + |
| 6 | +def test_get_experimental_features(client): |
| 7 | + """Test getting experimental features.""" |
| 8 | + response = client.get_experimental_features() |
| 9 | + assert isinstance(response, dict) |
| 10 | + assert "multimodal" in response or "vectorStoreSetting" in response |
| 11 | + |
| 12 | + |
| 13 | +def test_update_experimental_features(client): |
| 14 | + """Test updating experimental features.""" |
| 15 | + # Enable multimodal |
| 16 | + response = client.update_experimental_features({"multimodal": True}) |
| 17 | + assert isinstance(response, dict) |
| 18 | + assert response.get("multimodal") is True |
| 19 | + |
| 20 | + # Disable multimodal |
| 21 | + response = client.update_experimental_features({"multimodal": False}) |
| 22 | + assert isinstance(response, dict) |
| 23 | + assert response.get("multimodal") is False |
| 24 | + |
| 25 | + |
| 26 | +def test_enable_multimodal(client): |
| 27 | + """Test enabling multimodal experimental feature.""" |
| 28 | + response = client.enable_multimodal() |
| 29 | + assert isinstance(response, dict) |
| 30 | + assert response.get("multimodal") is True |
| 31 | + |
| 32 | + # Verify it's enabled |
| 33 | + features = client.get_experimental_features() |
| 34 | + assert features.get("multimodal") is True |
| 35 | + |
| 36 | + |
| 37 | +def test_disable_multimodal(client): |
| 38 | + """Test disabling multimodal experimental feature.""" |
| 39 | + # First enable it |
| 40 | + client.enable_multimodal() |
| 41 | + |
| 42 | + # Then disable it |
| 43 | + response = client.disable_multimodal() |
| 44 | + assert isinstance(response, dict) |
| 45 | + assert response.get("multimodal") is False |
| 46 | + |
| 47 | + # Verify it's disabled |
| 48 | + features = client.get_experimental_features() |
| 49 | + assert features.get("multimodal") is False |
| 50 | + |
| 51 | + |
| 52 | +def test_update_multiple_experimental_features(client): |
| 53 | + """Test updating multiple experimental features at once.""" |
| 54 | + response = client.update_experimental_features({ |
| 55 | + "multimodal": True, |
| 56 | + "vectorStoreSetting": True |
| 57 | + }) |
| 58 | + assert isinstance(response, dict) |
| 59 | + # At least one should be accepted (depending on Meilisearch version) |
| 60 | + assert "multimodal" in response or "vectorStoreSetting" in response |
0 commit comments