Skip to content

Commit dabf42c

Browse files
authored
Merge pull request #521 from meilisearch/add-tests-to-global-keys
Add a creation key use case with wildcards in the action field
2 parents 6100a19 + de63b38 commit dabf42c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/client/test_client_key_meilisearch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ def test_create_keys_with_options(client, test_key_info):
6262
assert key['actions'] == test_key_info['actions']
6363
assert key['indexes'] == test_key_info['indexes']
6464

65+
def test_create_keys_with_wildcarded_actions(client, test_key_info):
66+
"""Tests the creation of a key with an action which contains a wildcard."""
67+
key = client.create_key(options={'description': test_key_info['description'], 'actions': ['documents.*'], 'indexes': test_key_info['indexes'], 'expiresAt': None })
68+
69+
assert isinstance(key, dict)
70+
assert key['actions'] == ['documents.*']
71+
6572
def test_create_keys_without_actions(client):
6673
"""Tests the creation of a key with missing arguments."""
6774
with pytest.raises(MeiliSearchApiError):

0 commit comments

Comments
 (0)