Use correct HTTP method when updating pagure project
The correct method is PATCH not POST. Signed-off-by: Michal Konečný <mkonecny@redhat.com>
This commit is contained in:
parent
584d2f42c2
commit
e02d809f3b
2 changed files with 5 additions and 5 deletions
|
@ -886,7 +886,7 @@ class TestPagureChangeProjectMainAdmin:
|
|||
response_mock = Mock()
|
||||
response_mock.status_code = 200
|
||||
|
||||
self.pagure._requests_session.post.return_value = response_mock
|
||||
self.pagure._requests_session.patch.return_value = response_mock
|
||||
|
||||
namespace = "namespace"
|
||||
repo = "repo"
|
||||
|
@ -894,7 +894,7 @@ class TestPagureChangeProjectMainAdmin:
|
|||
|
||||
self.pagure.change_project_main_admin(namespace, repo, main_admin)
|
||||
|
||||
self.pagure._requests_session.post.assert_called_with(
|
||||
self.pagure._requests_session.patch.assert_called_with(
|
||||
"https://pagure.io/api/0/{0}/{1}".format(namespace, repo),
|
||||
data=json.dumps({"main_admin": main_admin}),
|
||||
headers=self.pagure.get_auth_header(),
|
||||
|
@ -907,7 +907,7 @@ class TestPagureChangeProjectMainAdmin:
|
|||
response_mock = Mock()
|
||||
response_mock.status_code = 500
|
||||
|
||||
self.pagure._requests_session.post.side_effect = response_mock
|
||||
self.pagure._requests_session.patch.side_effect = response_mock
|
||||
|
||||
namespace = "namespace"
|
||||
repo = "repo"
|
||||
|
@ -920,7 +920,7 @@ class TestPagureChangeProjectMainAdmin:
|
|||
with pytest.raises(PagureError, match=expected_error):
|
||||
self.pagure.change_project_main_admin(namespace, repo, main_admin)
|
||||
|
||||
self.pagure._requests_session.post.assert_called_with(
|
||||
self.pagure._requests_session.patch.assert_called_with(
|
||||
"https://pagure.io/api/0/{0}/{1}".format(namespace, repo),
|
||||
data=json.dumps({"main_admin": main_admin}),
|
||||
headers=self.pagure.get_auth_header(),
|
||||
|
|
|
@ -443,7 +443,7 @@ class Pagure:
|
|||
new_main_admin, namespace, repo
|
||||
)
|
||||
)
|
||||
response = self._requests_session.post(
|
||||
response = self._requests_session.patch(
|
||||
admin_api_url, data=json.dumps(payload), headers=headers
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue