@@ -30,13 +30,13 @@ class PatchworkMock(Patchwork):
3030 def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
3131 # Force patchwork to use loopback/port 0 for whatever network access
3232 # we fail to mock
33- # kwargs["server"] = "https://127.0.0.1:0 "
33+ # kwargs["server"] = "https://127.0.0.1"
3434 super ().__init__ (* args , ** kwargs )
3535
3636
3737def get_default_pw_client () -> PatchworkMock :
3838 return PatchworkMock (
39- server = "127.0.0.1:0 " ,
39+ server = "127.0.0.1" ,
4040 api_version = "1.1" ,
4141 search_patterns = [{"archived" : False , "project" : PROJECT , "delegate" : DELEGATE }],
4242 auth_token = "mocktoken" ,
@@ -83,7 +83,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
8383
8484DEFAULT_FREEZE_DATE = "2010-07-23T00:00:00"
8585DEFAULT_TEST_RESPONSES : Dict [str , Any ] = {
86- "https://127.0.0.1:0 /api/1.1/series/?q=foo" : [
86+ "https://127.0.0.1/api/1.1/series/?q=foo" : [
8787 # Does not match the subject name
8888 {
8989 "id" : 1 ,
@@ -170,7 +170,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
170170 },
171171 ],
172172 # Multiple relevant series to test our guess_pr logic.
173- "https://127.0.0.1:0 /api/1.1/series/?q=barv2" : [
173+ "https://127.0.0.1/api/1.1/series/?q=barv2" : [
174174 # Matches and has relevant diff.
175175 {
176176 "id" : 6 ,
@@ -197,7 +197,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
197197 },
198198 ],
199199 # Single relevant series to test our guess_pr logic.
200- "https://127.0.0.1:0 /api/1.1/series/?q=code" : [
200+ "https://127.0.0.1/api/1.1/series/?q=code" : [
201201 # Matches, has one relevant diffs, and is the most recent series.
202202 {
203203 "id" : 9 ,
@@ -213,42 +213,42 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
213213 },
214214 ],
215215 # Correct project and delegate
216- "https://127.0.0.1:0 /api/1.1/patches/11/" : {
216+ "https://127.0.0.1/api/1.1/patches/11/" : {
217217 "id" : 11 ,
218218 "project" : {"id" : PROJECT },
219219 "delegate" : {"id" : DELEGATE },
220220 "archived" : False ,
221221 },
222222 # wrong project
223- "https://127.0.0.1:0 /api/1.1/patches/12/" : {
223+ "https://127.0.0.1/api/1.1/patches/12/" : {
224224 "id" : 12 ,
225225 "project" : {"id" : PROJECT + 1 },
226226 "delegate" : {"id" : DELEGATE },
227227 "archived" : False ,
228228 },
229229 # Wrong delegate
230- "https://127.0.0.1:0 /api/1.1/patches/13/" : {
230+ "https://127.0.0.1/api/1.1/patches/13/" : {
231231 "id" : 13 ,
232232 "project" : {"id" : PROJECT },
233233 "delegate" : {"id" : DELEGATE + 1 },
234234 "archived" : False ,
235235 },
236236 # Correct project/delegate but archived
237- "https://127.0.0.1:0 /api/1.1/patches/14/" : {
237+ "https://127.0.0.1/api/1.1/patches/14/" : {
238238 "id" : 14 ,
239239 "project" : {"id" : PROJECT },
240240 "delegate" : {"id" : DELEGATE },
241241 "archived" : True ,
242242 },
243243 # None project
244- "https://127.0.0.1:0 /api/1.1/patches/15/" : {
244+ "https://127.0.0.1/api/1.1/patches/15/" : {
245245 "id" : 15 ,
246246 "project" : None ,
247247 "delegate" : {"id" : DELEGATE },
248248 "archived" : False ,
249249 },
250250 # None delegate
251- "https://127.0.0.1:0 /api/1.1/patches/16/" : {
251+ "https://127.0.0.1/api/1.1/patches/16/" : {
252252 "id" : 16 ,
253253 "project" : {"id" : PROJECT },
254254 "delegate" : None ,
@@ -258,7 +258,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
258258 # Series test cases #
259259 #####################
260260 # An open series, is a series that has no patch in irrelevant state.
261- "https://127.0.0.1:0 /api/1.1/series/665/" : {
261+ "https://127.0.0.1/api/1.1/series/665/" : {
262262 "id" : 665 ,
263263 "name" : "[a/b] this series is *NOT* closed!" ,
264264 "date" : "2010-07-20T01:00:00" ,
@@ -271,7 +271,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
271271 "mbox" : "https://example.com" ,
272272 },
273273 # Patch in an relevant state.
274- "https://127.0.0.1:0 /api/1.1/patches/6651/" : {
274+ "https://127.0.0.1/api/1.1/patches/6651/" : {
275275 "id" : 6651 ,
276276 "project" : {"id" : PROJECT },
277277 "delegate" : {"id" : DELEGATE },
@@ -281,7 +281,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
281281 "name" : "foo" ,
282282 },
283283 # Patch in a relevant state.
284- "https://127.0.0.1:0 /api/1.1/patches/6652/" : {
284+ "https://127.0.0.1/api/1.1/patches/6652/" : {
285285 "id" : 6652 ,
286286 "project" : {"id" : PROJECT },
287287 "delegate" : {"id" : DELEGATE },
@@ -293,7 +293,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
293293 "name" : "[0/5, 1/2 , v42, V24, first patch tag, second patch tag, patch , some stuff with spaces , patch] bar" ,
294294 },
295295 # Patch in an relevant state.
296- "https://127.0.0.1:0 /api/1.1/patches/6653/" : {
296+ "https://127.0.0.1/api/1.1/patches/6653/" : {
297297 "id" : 6653 ,
298298 "project" : {"id" : PROJECT },
299299 "delegate" : {"id" : DELEGATE },
@@ -303,7 +303,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
303303 "name" : "[duplicate tag] foo" ,
304304 },
305305 # A closed series, is a series that has at least 1 patch in an irrelevant state.
306- "https://127.0.0.1:0 /api/1.1/series/666/" : {
306+ "https://127.0.0.1/api/1.1/series/666/" : {
307307 "id" : 666 ,
308308 "name" : "this series is closed!" ,
309309 "date" : "2010-07-20T01:00:00" ,
@@ -315,23 +315,23 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
315315 "mbox" : "https://example.com" ,
316316 },
317317 # Patch in an irrelevant state.
318- "https://127.0.0.1:0 /api/1.1/patches/6661/" : {
318+ "https://127.0.0.1/api/1.1/patches/6661/" : {
319319 "id" : 6661 ,
320320 "project" : {"id" : PROJECT },
321321 "delegate" : {"id" : DELEGATE },
322322 "archived" : True ,
323323 "state" : get_dict_key (IRRELEVANT_STATES ),
324324 },
325325 # Patch in a relevant state.
326- "https://127.0.0.1:0 /api/1.1/patches/6662/" : {
326+ "https://127.0.0.1/api/1.1/patches/6662/" : {
327327 "id" : 6662 ,
328328 "project" : {"id" : PROJECT },
329329 "delegate" : {"id" : DELEGATE },
330330 "archived" : True ,
331331 "state" : get_dict_key (RELEVANT_STATES ),
332332 },
333333 # Series with no cover letter and no patches.
334- "https://127.0.0.1:0 /api/1.1/series/667/" : {
334+ "https://127.0.0.1/api/1.1/series/667/" : {
335335 "id" : 667 ,
336336 "name" : "this series has no cover letter!" ,
337337 "date" : "2010-07-20T01:00:00" ,
@@ -345,7 +345,7 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
345345 },
346346 # Expiration test cases
347347 # Series with expirable patches.
348- "https://127.0.0.1:0 /api/1.1/series/668/" : {
348+ "https://127.0.0.1/api/1.1/series/668/" : {
349349 "id" : 668 ,
350350 "name" : "this series has no cover letter!" ,
351351 "date" : "2010-07-20T01:00:00" ,
@@ -358,15 +358,15 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
358358 "mbox" : "https://example.com" ,
359359 },
360360 # Patch in a non-expirable state.
361- "https://127.0.0.1:0 /api/1.1/patches/6681/" : {
361+ "https://127.0.0.1/api/1.1/patches/6681/" : {
362362 "id" : 6681 ,
363363 "project" : {"id" : PROJECT },
364364 "delegate" : {"id" : DELEGATE },
365365 "archived" : True ,
366366 "state" : "new" ,
367367 },
368368 # Patch in an expirable state.
369- "https://127.0.0.1:0 /api/1.1/patches/6682/" : {
369+ "https://127.0.0.1/api/1.1/patches/6682/" : {
370370 "id" : 6682 ,
371371 "project" : {"id" : PROJECT },
372372 "delegate" : {"id" : DELEGATE },
@@ -375,15 +375,15 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
375375 "date" : DEFAULT_FREEZE_DATE ,
376376 },
377377 # Patch in a non-expirable state.
378- "https://127.0.0.1:0 /api/1.1/patches/6683/" : {
378+ "https://127.0.0.1/api/1.1/patches/6683/" : {
379379 "id" : 6683 ,
380380 "project" : {"id" : PROJECT },
381381 "delegate" : {"id" : DELEGATE },
382382 "archived" : True ,
383383 "state" : "new" ,
384384 },
385385 # Series with no expirable patches.
386- "https://127.0.0.1:0 /api/1.1/series/669/" : {
386+ "https://127.0.0.1/api/1.1/series/669/" : {
387387 "id" : 669 ,
388388 "name" : "this series has no cover letter!" ,
389389 "date" : "2010-07-20T01:00:00" ,
@@ -396,23 +396,23 @@ def get_dict_key(d: Dict[str, Any], idx: int = 0) -> str:
396396 "mbox" : "https://example.com" ,
397397 },
398398 # Patch in a non-expirable state.
399- "https://127.0.0.1:0 /api/1.1/patches/6691/" : {
399+ "https://127.0.0.1/api/1.1/patches/6691/" : {
400400 "id" : 6691 ,
401401 "project" : {"id" : PROJECT },
402402 "delegate" : {"id" : DELEGATE },
403403 "archived" : True ,
404404 "state" : "new" ,
405405 },
406406 # Patch in a non-expirable state.
407- "https://127.0.0.1:0 /api/1.1/patches/6692/" : {
407+ "https://127.0.0.1/api/1.1/patches/6692/" : {
408408 "id" : 6692 ,
409409 "project" : {"id" : PROJECT },
410410 "delegate" : {"id" : DELEGATE },
411411 "archived" : True ,
412412 "state" : "new" ,
413413 },
414414 # Patch in a non-expirable state.
415- "https://127.0.0.1:0 /api/1.1/patches/6693/" : {
415+ "https://127.0.0.1/api/1.1/patches/6693/" : {
416416 "id" : 6693 ,
417417 "project" : {"id" : PROJECT },
418418 "delegate" : {"id" : DELEGATE },
0 commit comments