Skip to content

Commit aae5144

Browse files
committed
test: get rid of json_params_matcher deprecation warning
1 parent 67df8a7 commit aae5144

6 files changed

Lines changed: 27 additions & 26 deletions

File tree

ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
## NEXT
99

1010
* dependency updates to fix requests CVE-2023-32681.
11-
* be REUSE compliant
11+
* be REUSE compliant.
12+
* get rid of json_params_matcher deprecation warning.
1213

1314
## V1.2.1
1415

tests/test_sw360_components.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2020 Siemens
2+
# Copyright (c) 2020-2023 Siemens
33
# All Rights Reserved.
44
# Author: thomas.graf@siemens.com
55
#
@@ -310,7 +310,7 @@ def test_update_component_external_id_add_fresh_id(self):
310310
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
311311
body="4",
312312
match=[
313-
responses.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
313+
responses.matchers.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
314314
]
315315
)
316316

@@ -365,7 +365,7 @@ def test_update_component_external_id_overwrite(self):
365365
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
366366
body="4",
367367
match=[
368-
responses.json_params_matcher({"externalIds": {"package-url": "new-one"}})
368+
responses.matchers.json_params_matcher({"externalIds": {"package-url": "new-one"}})
369369
]
370370
)
371371

@@ -398,7 +398,7 @@ def test_update_component_external_id_delete(self):
398398
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
399399
body="4",
400400
match=[
401-
responses.json_params_matcher({"externalIds": {}})
401+
responses.matchers.json_params_matcher({"externalIds": {}})
402402
]
403403
)
404404

@@ -431,7 +431,7 @@ def test_update_component_external_id_no_exist(self):
431431
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
432432
body="4",
433433
match=[
434-
responses.json_params_matcher(
434+
responses.matchers.json_params_matcher(
435435
{
436436
"externalIds": {"xxx": "pkg:deb/debian/debootstrap?type=source"}
437437
}
@@ -468,7 +468,7 @@ def test_update_component_external_id_no_extids_yet(self):
468468
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
469469
body="4",
470470
match=[
471-
responses.json_params_matcher({"externalIds": {"package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
471+
responses.matchers.json_params_matcher({"externalIds": {"package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
472472
]
473473
)
474474

@@ -498,7 +498,7 @@ def test_create_new_component(self):
498498
}
499499
},
500500
match=[
501-
responses.json_params_matcher({
501+
responses.matchers.json_params_matcher({
502502
"name": "NewComponent",
503503
"componentType": "OSS",
504504
"description": "Illustrative example component",
@@ -531,7 +531,7 @@ def test_create_new_component_fail(self):
531531
},
532532
status=409,
533533
match=[
534-
responses.json_params_matcher({
534+
responses.matchers.json_params_matcher({
535535
"name": "NewComponent",
536536
"componentType": "OSS",
537537
"description": "Illustrative example component",

tests/test_sw360_licenses.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2020 Siemens
2+
# Copyright (c) 2020-2023 Siemens
33
# All Rights Reserved.
44
# Author: thomas.graf@siemens.com
55
#
@@ -145,7 +145,7 @@ def test_create_new_license(self):
145145
}
146146
}
147147
},
148-
match=[responses.json_params_matcher({
148+
match=[responses.matchers.json_params_matcher({
149149
"shortName": "LGPL-2.0-only",
150150
"fullName": "GNU Library General Public License v2 only",
151151
"checked": True,
@@ -180,7 +180,7 @@ def test_create_new_license_fail(self):
180180
}
181181
}
182182
},
183-
match=[responses.json_params_matcher({
183+
match=[responses.matchers.json_params_matcher({
184184
"shortName": "LGPL-2.0-only",
185185
"fullName": "GNU Library General Public License v2 only",
186186
"checked": True,

tests/test_sw360_projects.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2019-2022 Siemens
2+
# Copyright (c) 2019-2023 Siemens
33
# All Rights Reserved.
44
# Author: thomas.graf@siemens.com
55
#
@@ -515,7 +515,7 @@ def test_create_new_project(self):
515515
}
516516
},
517517
match=[
518-
responses.json_params_matcher({
518+
responses.matchers.json_params_matcher({
519519
"name": "NewProduct", "version": "42",
520520
"description": "Example Product",
521521
"projectType": "PRODUCT", "visibility": "EVERYONE",
@@ -541,7 +541,7 @@ def test_create_new_project_already_exists(self):
541541
},
542542
status=409,
543543
match=[
544-
responses.json_params_matcher({
544+
responses.matchers.json_params_matcher({
545545
"name": "NewProduct", "version": "42",
546546
"description": "Example Product",
547547
"projectType": "PRODUCT", "visibility": "EVERYONE",
@@ -600,7 +600,7 @@ def test_update_project_sub_projects_no_add(self):
600600
body="4",
601601
status=202,
602602
match=[
603-
responses.json_params_matcher({
603+
responses.matchers.json_params_matcher({
604604
"name": "NewComponent",
605605
"version": "9.99",
606606
"projectType": "PRODUCT",
@@ -647,7 +647,7 @@ def test_update_project_sub_projects_with_add(self):
647647
body="4",
648648
status=202,
649649
match=[
650-
responses.json_params_matcher({
650+
responses.matchers.json_params_matcher({
651651
"name": "NewComponent",
652652
"version": "9.99",
653653
"projectType": "PRODUCT",
@@ -826,7 +826,7 @@ def test_update_project_external_id_add_fresh_id(self):
826826
url=self.MYURL + "resource/api/projects/123",
827827
body="4",
828828
match=[
829-
responses.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
829+
responses.matchers.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
830830
]
831831
)
832832

@@ -906,7 +906,7 @@ def test_duplicate_project(self):
906906
},
907907
},
908908
match=[
909-
responses.json_params_matcher({
909+
responses.matchers.json_params_matcher({
910910
"version": "42",
911911
'clearingState': 'OPEN',
912912
})
@@ -1018,7 +1018,7 @@ def test_update_project_release_relationship(self):
10181018
body="4",
10191019
status=202,
10201020
match=[
1021-
responses.json_params_matcher({
1021+
responses.matchers.json_params_matcher({
10221022
"releaseRelation": "STANDALONE",
10231023
"mainlineState": "SPECIFIC",
10241024
"comment": "mycomment"

tests/test_sw360_releases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def test_create_new_release(self):
268268
}
269269
},
270270
match=[
271-
responses.json_params_matcher({
271+
responses.matchers.json_params_matcher({
272272
"name": "NewComponent", "version": "1.0.0",
273273
"componentId": "9876"
274274
})
@@ -293,7 +293,7 @@ def test_create_new_release_already_exists(self):
293293
},
294294
status=409,
295295
match=[
296-
responses.json_params_matcher({
296+
responses.matchers.json_params_matcher({
297297
"name": "NewComponent", "version": "1.0.0",
298298
"componentId": "9876"
299299
})
@@ -396,7 +396,7 @@ def test_update_release_external_id_add_fresh_id(self):
396396
url=self.MYURL + "resource/api/releases/123",
397397
body="4",
398398
match=[
399-
responses.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
399+
responses.matchers.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
400400
]
401401
)
402402

tests/test_sw360_vendors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def test_create_new_vendor(self):
162162
body='{"status": "success"}',
163163
status=201,
164164
match=[
165-
responses.json_params_matcher({
165+
responses.matchers.json_params_matcher({
166166
"url": "https://github.com/tngraf",
167167
"shortName": "tngraf",
168168
"fullName": "Thomas Graf"
@@ -192,7 +192,7 @@ def test_create_new_vendor_fail(self):
192192
body='{"status": "success"}',
193193
status=403,
194194
match=[
195-
responses.json_params_matcher({
195+
responses.matchers.json_params_matcher({
196196
"url": "https://github.com/tngraf",
197197
"shortName": "tngraf",
198198
"fullName": "Thomas Graf"
@@ -241,7 +241,7 @@ def test_update_vendor(self):
241241
body="4",
242242
status=201,
243243
match=[
244-
responses.json_params_matcher({
244+
responses.matchers.json_params_matcher({
245245
"shortName": "xxx",
246246
})
247247
],

0 commit comments

Comments
 (0)