Skip to content

Commit ee498ac

Browse files
Merge #397
397: Refactor version test r=alallema a=sanders41 # Pull Request `@alallema` we basically had the same idea. Since we know the expected format my thinking here is the first item in the list should start with `Meilisearch Python (`, then the specific version is already tested in `meilisearch-python` so we can trust that is correct. ## Related issue Discussed in #396 ## What does this PR do? - Makes it where the test won't fail with every update to `meilisearch-python` ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Paul Sanders <[email protected]>
2 parents 431a08d + e340410 commit ee498ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/meilisearch_helper/meilisearch_helper_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import requests
66

7-
from scraper.src.meilisearch_helper import MeiliSearchHelper
87
from scraper.src.config.version import __version__
8+
from scraper.src.meilisearch_helper import MeiliSearchHelper
99
from tests.meilisearch_helper import common
1010

1111

@@ -34,4 +34,7 @@ def test_use_meilisearch_default(self, mock_delete, mock_patch):
3434
)
3535

3636
# Then
37-
assert actual.meilisearch_client.http.headers['User-Agent'] == f"Meilisearch Python (v0.27.0);Meilisearch DocsScraper (v{__version__})"
37+
split_version = actual.meilisearch_client.http.headers['User-Agent'].split(";")
38+
assert len(split_version) == 2
39+
assert split_version[0].startswith("Meilisearch Python (") is True
40+
assert split_version[1] == f"Meilisearch DocsScraper (v{__version__})"

0 commit comments

Comments
 (0)