@@ -78,21 +78,21 @@ def test_search_dataset_basic():
7878 activate = True )
7979 db = db_api .APIInterrogator (api = api )
8080 # Positive test
81- data = db .search_dataset (query = "dcoraid" ,
82- circles = [defaults ["circle" ]],
83- collections = [defaults ["collection" ]],
84- )
81+ data = db .search_dataset_via_api (query = "dcoraid" ,
82+ circles = [defaults ["circle" ]],
83+ collections = [defaults ["collection" ]],
84+ )
8585 assert len (data ) >= 1
8686 for dd in data :
8787 if dd ["name" ].endswith (ranstr ):
8888 break
8989 else :
9090 assert False , "{} not found!" .format (defaults ["dataset" ])
9191 # Negative test
92- data = db .search_dataset (query = "cliauwenlc_should_never_exist" ,
93- circles = [defaults ["circle" ]],
94- collections = [defaults ["collection" ]],
95- )
92+ data = db .search_dataset_via_api (query = "cliauwenlc_should_never_exist" ,
93+ circles = [defaults ["circle" ]],
94+ collections = [defaults ["collection" ]],
95+ )
9696 assert len (data ) == 0 , "search result for non-existent dataset?"
9797
9898
@@ -115,19 +115,21 @@ def test_search_dataset_limit():
115115 activate = True )
116116 dataset_ids .append (ds_dict ["id" ])
117117 db = db_api .APIInterrogator (api = api )
118- data_limited = db .search_dataset (query = ranstr ,
119- circles = [defaults ["circle" ]],
120- collections = [defaults ["collection" ]],
121- circle_collection_union = True ,
122- limit = 2
123- )
118+ data_limited = db .search_dataset_via_api (
119+ query = ranstr ,
120+ circles = [defaults ["circle" ]],
121+ collections = [defaults ["collection" ]],
122+ circle_collection_union = True ,
123+ limit = 2
124+ )
124125 assert len (data_limited ) == 2
125- data_unlimited = db .search_dataset (query = ranstr ,
126- circles = [defaults ["circle" ]],
127- collections = [defaults ["collection" ]],
128- circle_collection_union = True ,
129- limit = 0
130- )
126+ data_unlimited = db .search_dataset_via_api (
127+ query = ranstr ,
128+ circles = [defaults ["circle" ]],
129+ collections = [defaults ["collection" ]],
130+ circle_collection_union = True ,
131+ limit = 0
132+ )
131133 assert len (data_unlimited ) == 3
132134
133135
@@ -148,12 +150,13 @@ def test_search_dataset_limit_negative_error():
148150 activate = True )
149151 db = db_api .APIInterrogator (api = api )
150152 with pytest .raises (ValueError , match = "must be 0 or >0" ):
151- db .search_dataset (query = ranstr ,
152- circles = [defaults ["circle" ]],
153- collections = [defaults ["collection" ]],
154- circle_collection_union = True ,
155- limit = - 1
156- )
153+ db .search_dataset_via_api (
154+ query = ranstr ,
155+ circles = [defaults ["circle" ]],
156+ collections = [defaults ["collection" ]],
157+ circle_collection_union = True ,
158+ limit = - 1
159+ )
157160
158161
159162@pytest .mark .skipif (not HAS_FIGSHARE_ACCESS ,
@@ -162,7 +165,8 @@ def test_search_dataset_only_one_filter_query():
162165 # The figshare circle must have the testing user as a member
163166 api = common .get_api ()
164167 db = db_api .APIInterrogator (api = api )
165- ds = db .search_dataset (filter_queries = [f"-creator_user_id:{ api .user_id } " ])
168+ ds = db .search_dataset_via_api (
169+ filter_queries = [f"-creator_user_id:{ api .user_id } " ])
166170 for di in ds :
167171 if di ["name" ] == "figshare-7771184-v2" :
168172 break
0 commit comments