Skip to content

Commit

Permalink
test: get rid of json_params_matcher deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tngraf committed May 27, 2023
1 parent 67df8a7 commit aae5144
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 26 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
## NEXT

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

## V1.2.1

Expand Down
16 changes: 8 additions & 8 deletions tests/test_sw360_components.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -------------------------------------------------------------------------------
# Copyright (c) 2020 Siemens
# Copyright (c) 2020-2023 Siemens
# All Rights Reserved.
# Author: [email protected]
#
Expand Down Expand Up @@ -310,7 +310,7 @@ def test_update_component_external_id_add_fresh_id(self):
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
body="4",
match=[
responses.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
responses.matchers.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
]
)

Expand Down Expand Up @@ -365,7 +365,7 @@ def test_update_component_external_id_overwrite(self):
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
body="4",
match=[
responses.json_params_matcher({"externalIds": {"package-url": "new-one"}})
responses.matchers.json_params_matcher({"externalIds": {"package-url": "new-one"}})
]
)

Expand Down Expand Up @@ -398,7 +398,7 @@ def test_update_component_external_id_delete(self):
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
body="4",
match=[
responses.json_params_matcher({"externalIds": {}})
responses.matchers.json_params_matcher({"externalIds": {}})
]
)

Expand Down Expand Up @@ -431,7 +431,7 @@ def test_update_component_external_id_no_exist(self):
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
body="4",
match=[
responses.json_params_matcher(
responses.matchers.json_params_matcher(
{
"externalIds": {"xxx": "pkg:deb/debian/debootstrap?type=source"}
}
Expand Down Expand Up @@ -468,7 +468,7 @@ def test_update_component_external_id_no_extids_yet(self):
url=self.MYURL + "resource/api/components/bc75c910ca9866886cb4d7b3a301061f",
body="4",
match=[
responses.json_params_matcher({"externalIds": {"package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
responses.matchers.json_params_matcher({"externalIds": {"package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
]
)

Expand Down Expand Up @@ -498,7 +498,7 @@ def test_create_new_component(self):
}
},
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewComponent",
"componentType": "OSS",
"description": "Illustrative example component",
Expand Down Expand Up @@ -531,7 +531,7 @@ def test_create_new_component_fail(self):
},
status=409,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewComponent",
"componentType": "OSS",
"description": "Illustrative example component",
Expand Down
6 changes: 3 additions & 3 deletions tests/test_sw360_licenses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -------------------------------------------------------------------------------
# Copyright (c) 2020 Siemens
# Copyright (c) 2020-2023 Siemens
# All Rights Reserved.
# Author: [email protected]
#
Expand Down Expand Up @@ -145,7 +145,7 @@ def test_create_new_license(self):
}
}
},
match=[responses.json_params_matcher({
match=[responses.matchers.json_params_matcher({
"shortName": "LGPL-2.0-only",
"fullName": "GNU Library General Public License v2 only",
"checked": True,
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_create_new_license_fail(self):
}
}
},
match=[responses.json_params_matcher({
match=[responses.matchers.json_params_matcher({
"shortName": "LGPL-2.0-only",
"fullName": "GNU Library General Public License v2 only",
"checked": True,
Expand Down
16 changes: 8 additions & 8 deletions tests/test_sw360_projects.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -------------------------------------------------------------------------------
# Copyright (c) 2019-2022 Siemens
# Copyright (c) 2019-2023 Siemens
# All Rights Reserved.
# Author: [email protected]
#
Expand Down Expand Up @@ -515,7 +515,7 @@ def test_create_new_project(self):
}
},
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewProduct", "version": "42",
"description": "Example Product",
"projectType": "PRODUCT", "visibility": "EVERYONE",
Expand All @@ -541,7 +541,7 @@ def test_create_new_project_already_exists(self):
},
status=409,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewProduct", "version": "42",
"description": "Example Product",
"projectType": "PRODUCT", "visibility": "EVERYONE",
Expand Down Expand Up @@ -600,7 +600,7 @@ def test_update_project_sub_projects_no_add(self):
body="4",
status=202,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewComponent",
"version": "9.99",
"projectType": "PRODUCT",
Expand Down Expand Up @@ -647,7 +647,7 @@ def test_update_project_sub_projects_with_add(self):
body="4",
status=202,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewComponent",
"version": "9.99",
"projectType": "PRODUCT",
Expand Down Expand Up @@ -826,7 +826,7 @@ def test_update_project_external_id_add_fresh_id(self):
url=self.MYURL + "resource/api/projects/123",
body="4",
match=[
responses.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
responses.matchers.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
]
)

Expand Down Expand Up @@ -906,7 +906,7 @@ def test_duplicate_project(self):
},
},
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"version": "42",
'clearingState': 'OPEN',
})
Expand Down Expand Up @@ -1018,7 +1018,7 @@ def test_update_project_release_relationship(self):
body="4",
status=202,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"releaseRelation": "STANDALONE",
"mainlineState": "SPECIFIC",
"comment": "mycomment"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_sw360_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def test_create_new_release(self):
}
},
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewComponent", "version": "1.0.0",
"componentId": "9876"
})
Expand All @@ -293,7 +293,7 @@ def test_create_new_release_already_exists(self):
},
status=409,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"name": "NewComponent", "version": "1.0.0",
"componentId": "9876"
})
Expand Down Expand Up @@ -396,7 +396,7 @@ def test_update_release_external_id_add_fresh_id(self):
url=self.MYURL + "resource/api/releases/123",
body="4",
match=[
responses.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
responses.matchers.json_params_matcher({"externalIds": {"already-existing": "must-be-kept", "package-url": "pkg:deb/debian/debootstrap?type=source"}}) # noqa
]
)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_sw360_vendors.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_create_new_vendor(self):
body='{"status": "success"}',
status=201,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"url": "https://github.com/tngraf",
"shortName": "tngraf",
"fullName": "Thomas Graf"
Expand Down Expand Up @@ -192,7 +192,7 @@ def test_create_new_vendor_fail(self):
body='{"status": "success"}',
status=403,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"url": "https://github.com/tngraf",
"shortName": "tngraf",
"fullName": "Thomas Graf"
Expand Down Expand Up @@ -241,7 +241,7 @@ def test_update_vendor(self):
body="4",
status=201,
match=[
responses.json_params_matcher({
responses.matchers.json_params_matcher({
"shortName": "xxx",
})
],
Expand Down

0 comments on commit aae5144

Please sign in to comment.