File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -93,16 +93,18 @@ def get_indexes(self) -> List[Index]:
93
93
"""
94
94
response = self .http .get (self .config .paths .index )
95
95
96
- return [
97
- Index (
98
- self .config ,
99
- index ["uid" ],
100
- index ["primaryKey" ],
101
- index ["createdAt" ],
102
- index ["updatedAt" ],
103
- )
104
- for index in response ['results' ]
105
- ]
96
+ return {
97
+ 'results' : [
98
+ Index (
99
+ self .config ,
100
+ index ["uid" ],
101
+ index ["primaryKey" ],
102
+ index ["createdAt" ],
103
+ index ["updatedAt" ],
104
+ )
105
+ for index in response ['results' ]
106
+ ]
107
+ }
106
108
107
109
def get_raw_indexes (self ) -> List [Dict [str , Any ]]:
108
110
"""Get all indexes in dictionary format.
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def clear_indexes(client):
21
21
yield
22
22
# Deletes all the indexes in the Meilisearch instance.
23
23
indexes = client .get_indexes ()
24
- for index in indexes :
24
+ for index in indexes [ 'results' ] :
25
25
task = client .index (index .uid ).delete ()
26
26
client .wait_for_task (task ['uid' ])
27
27
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def test_create_index_with_uid_in_options(client):
40
40
def test_get_indexes (client ):
41
41
"""Tests getting all indexes."""
42
42
response = client .get_indexes ()
43
- uids = [index .uid for index in response ]
43
+ uids = [index .uid for index in response [ 'results' ] ]
44
44
assert isinstance (response , list )
45
45
assert common .INDEX_UID in uids
46
46
assert common .INDEX_UID2 in uids
@@ -165,7 +165,7 @@ def test_delete_index_by_client(client):
165
165
client .wait_for_task (response ['uid' ])
166
166
with pytest .raises (Exception ):
167
167
client .get_index (uid = common .INDEX_UID3 )
168
- assert len (client .get_indexes ()) == 0
168
+ assert len (client .get_indexes ()[ 'results' ] ) == 0
169
169
170
170
@pytest .mark .usefixtures ("indexes_sample" )
171
171
def test_delete (client ):
You can’t perform that action at this time.
0 commit comments