Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5a4ab6

Browse files
test: convert usage ofmatch_querystring tomatch
In the `responses` library the usage of `match_querystring` isdeprecated. Convert to using `match`
1 parent5254f19 commitc5a4ab6

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

‎tests/unit/mixins/test_mixin_methods.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class M(GetMixin, FakeManager):
3535
url=url,
3636
json={"id":42,"foo":"bar"},
3737
status=200,
38-
match_querystring=True,
38+
match=[responses.matchers.query_param_matcher({})],
3939
)
4040

4141
mgr=M(gl)
@@ -57,7 +57,7 @@ class TestClass(RefreshMixin, FakeObject):
5757
url=url,
5858
json={"id":42,"foo":"bar"},
5959
status=200,
60-
match_querystring=True,
60+
match=[responses.matchers.query_param_matcher({})],
6161
)
6262

6363
mgr=FakeManager(gl)
@@ -80,7 +80,7 @@ class M(GetWithoutIdMixin, FakeManager):
8080
url=url,
8181
json={"foo":"bar"},
8282
status=200,
83-
match_querystring=True,
83+
match=[responses.matchers.query_param_matcher({})],
8484
)
8585

8686
mgr=M(gl)
@@ -102,7 +102,7 @@ class M(ListMixin, FakeManager):
102102
url=url,
103103
json=[{"id":42,"foo":"bar"}, {"id":43,"foo":"baz"}],
104104
status=200,
105-
match_querystring=True,
105+
match=[responses.matchers.query_param_matcher({})],
106106
)
107107

108108
# test RESTObjectList
@@ -134,7 +134,7 @@ class M(ListMixin, FakeManager):
134134
url=url,
135135
json=[{"id":42,"foo":"bar"}],
136136
status=200,
137-
match_querystring=True,
137+
match=[responses.matchers.query_param_matcher({})],
138138
)
139139

140140
mgr=M(gl)
@@ -177,7 +177,7 @@ class M(CreateMixin, FakeManager):
177177
url=url,
178178
json={"id":42,"foo":"bar"},
179179
status=200,
180-
match_querystring=True,
180+
match=[responses.matchers.query_param_matcher({})],
181181
)
182182

183183
mgr=M(gl)
@@ -202,7 +202,7 @@ class M(CreateMixin, FakeManager):
202202
url=url,
203203
json={"id":42,"foo":"bar"},
204204
status=200,
205-
match_querystring=True,
205+
match=[responses.matchers.query_param_matcher({})],
206206
)
207207

208208
mgr=M(gl)
@@ -243,7 +243,7 @@ class M(UpdateMixin, FakeManager):
243243
url=url,
244244
json={"id":42,"foo":"baz"},
245245
status=200,
246-
match_querystring=True,
246+
match=[responses.matchers.query_param_matcher({})],
247247
)
248248

249249
mgr=M(gl)
@@ -268,7 +268,7 @@ class M(UpdateMixin, FakeManager):
268268
url=url,
269269
json={"foo":"baz"},
270270
status=200,
271-
match_querystring=True,
271+
match=[responses.matchers.query_param_matcher({})],
272272
)
273273

274274
mgr=M(gl)
@@ -289,7 +289,7 @@ class M(DeleteMixin, FakeManager):
289289
url=url,
290290
json="",
291291
status=200,
292-
match_querystring=True,
292+
match=[responses.matchers.query_param_matcher({})],
293293
)
294294

295295
mgr=M(gl)
@@ -311,7 +311,7 @@ class TestClass(SaveMixin, base.RESTObject):
311311
url=url,
312312
json={"id":42,"foo":"baz"},
313313
status=200,
314-
match_querystring=True,
314+
match=[responses.matchers.query_param_matcher({})],
315315
)
316316

317317
mgr=M(gl)
@@ -334,7 +334,7 @@ class M(SetMixin, FakeManager):
334334
url=url,
335335
json={"key":"foo","value":"bar"},
336336
status=200,
337-
match_querystring=True,
337+
match=[responses.matchers.query_param_matcher({})],
338338
)
339339

340340
mgr=M(gl)

‎tests/unit/test_gitlab.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def resp_page_1():
5858
"headers":headers,
5959
"content_type":"application/json",
6060
"status":200,
61-
"match_querystring":True,
61+
"match":[responses.matchers.query_param_matcher({})],
6262
}
6363

6464

@@ -81,7 +81,6 @@ def resp_page_2():
8181
"content_type":"application/json",
8282
"status":200,
8383
"match": [responses.matchers.query_param_matcher(params)],
84-
"match_querystring":False,
8584
}
8685

8786

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp