Skip to content

Commit 6805fd8

Browse files
committed
polish test
1 parent be30ad5 commit 6805fd8

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/openapi/test_strictmode.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2432,7 +2432,7 @@ def test_strict_mode_payload_index_count(collection_name):
24322432
assert new_strict_mode_config['enabled']
24332433
assert new_strict_mode_config['max_payload_index_count'] == 0
24342434

2435-
# should fail now with 1 index already
2435+
# should fail because zero payload indexes allowed
24362436
response = request_with_validation(
24372437
api='/collections/{collection_name}/index',
24382438
method="PUT",
@@ -2504,6 +2504,16 @@ def test_strict_mode_payload_index_count(collection_name):
25042504
"max_payload_index_count": 2,
25052505
})
25062506

2507+
# verify config reflects the new limit
2508+
response = request_with_validation(
2509+
api='/collections/{collection_name}',
2510+
method="GET",
2511+
path_params={'collection_name': collection_name},
2512+
)
2513+
assert response.ok
2514+
cfg = response.json()['result']['config']['strict_mode_config']
2515+
assert cfg['max_payload_index_count'] == 2
2516+
25072517
# should work now with 2 indices allowed
25082518
request_with_validation(
25092519
api='/collections/{collection_name}/index',
@@ -2540,6 +2550,8 @@ def test_strict_mode_payload_index_count(collection_name):
25402550
"enabled": False,
25412551
})
25422552

2553+
assert not strict_mode_enabled(collection_name)
2554+
25432555
# should work now without strict mode
25442556
request_with_validation(
25452557
api='/collections/{collection_name}/index',

0 commit comments

Comments
 (0)