@@ -58,7 +58,7 @@ def test_add_hash_index(icol):
58
58
"sparse" : True ,
59
59
"deduplicate" : True ,
60
60
"name" : "hash_index" ,
61
- "in_background " : False ,
61
+ "inBackground " : False ,
62
62
}
63
63
)
64
64
@@ -89,7 +89,7 @@ def test_add_skiplist_index(icol):
89
89
"sparse" : True ,
90
90
"deduplicate" : True ,
91
91
"name" : "skiplist_index" ,
92
- "in_background " : False ,
92
+ "inBackground " : False ,
93
93
}
94
94
)
95
95
@@ -116,9 +116,9 @@ def test_add_geo_index(icol):
116
116
{
117
117
"type" : "geo" ,
118
118
"fields" : ["attr1" ],
119
- "geo_json " : True ,
119
+ "geoJson " : True ,
120
120
"name" : "geo_index" ,
121
- "in_background " : True ,
121
+ "inBackground " : True ,
122
122
}
123
123
)
124
124
@@ -140,7 +140,7 @@ def test_add_geo_index(icol):
140
140
{
141
141
"type" : "geo" ,
142
142
"fields" : ["attr1" , "attr2" ],
143
- "geo_json " : False ,
143
+ "geoJson " : False ,
144
144
}
145
145
)
146
146
expected_index = {
@@ -169,9 +169,9 @@ def test_add_fulltext_index(icol):
169
169
{
170
170
"type" : "fulltext" ,
171
171
"fields" : ["attr1" ],
172
- "min_length " : 10 ,
172
+ "minLength " : 10 ,
173
173
"name" : "fulltext_index" ,
174
- "in_background " : True ,
174
+ "inBackground " : True ,
175
175
}
176
176
)
177
177
expected_index = {
@@ -205,7 +205,7 @@ def test_add_persistent_index(icol):
205
205
"unique" : True ,
206
206
"sparse" : True ,
207
207
"name" : "persistent_index" ,
208
- "in_background " : True ,
208
+ "inBackground " : True ,
209
209
}
210
210
)
211
211
expected_index = {
@@ -230,9 +230,9 @@ def test_add_ttl_index(icol):
230
230
{
231
231
"type" : "ttl" ,
232
232
"fields" : ["attr1" ],
233
- "expiry_time " : 1000 ,
233
+ "expireAfter " : 1000 ,
234
234
"name" : "ttl_index" ,
235
- "in_background " : True ,
235
+ "inBackground " : True ,
236
236
}
237
237
)
238
238
expected_index = {
@@ -280,9 +280,9 @@ def test_add_zkd_index(icol, db_version):
280
280
{
281
281
"type" : "zkd" ,
282
282
"fields" : ["x" , "y" , "z" ],
283
- "field_value_types " : "double" ,
283
+ "fieldValueTypes " : "double" ,
284
284
"name" : "zkd_index" ,
285
- "in_background " : False ,
285
+ "inBackground " : False ,
286
286
"unique" : False ,
287
287
}
288
288
)
@@ -301,7 +301,9 @@ def test_add_zkd_index(icol, db_version):
301
301
assert result ["id" ] in extract ("id" , icol .indexes ())
302
302
303
303
with assert_raises (IndexCreateError ) as err :
304
- icol .add_zkd_index (field_value_types = "integer" , fields = ["x" , "y" , "z" ])
304
+ icol .add_index (
305
+ {"type" : "zkd" , "fieldValueTypes" : "integer" , "fields" : ["x" , "y" , "z" ]}
306
+ )
305
307
assert err .value .error_code == 10
306
308
307
309
icol .delete_index (result ["id" ])
@@ -315,9 +317,9 @@ def test_add_mdi_index(icol, db_version):
315
317
{
316
318
"type" : "mdi" ,
317
319
"fields" : ["x" , "y" , "z" ],
318
- "field_value_types " : "double" ,
320
+ "fieldValueTypes " : "double" ,
319
321
"name" : "mdi_index" ,
320
- "in_background " : False ,
322
+ "inBackground " : False ,
321
323
"unique" : True ,
322
324
}
323
325
)
@@ -336,7 +338,13 @@ def test_add_mdi_index(icol, db_version):
336
338
assert result ["id" ] in extract ("id" , icol .indexes ())
337
339
338
340
with assert_raises (IndexCreateError ) as err :
339
- icol .add_mdi_index (field_value_types = "integer" , fields = ["x" , "y" , "z" ])
341
+ icol .add_index (
342
+ {
343
+ "type" : "mdi" ,
344
+ "fieldValueTypes" : "integer" ,
345
+ "fields" : ["x" , "y" , "z" ],
346
+ }
347
+ )
340
348
assert err .value .error_code == 10
341
349
342
350
icol .delete_index (result ["id" ])
0 commit comments