mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 03:11:09 +00:00
Add a trailing slash to URL when updating or deleting a file (tests fixed) (#931)
* Add a trailing slash to URL when updating or deleting a file. * Update test files to match new create/update/delete_file Repo methods * Add trailing slash to get_contents() method * update tests * add missing slash in get_dir_contents * add example usage * remove dup slashes in tests * clarify example comments
This commit is contained in:
@@ -1449,7 +1449,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
url_parameters["ref"] = ref
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
self.url + "/contents/" + urllib.quote(path),
|
||||
parameters=url_parameters
|
||||
)
|
||||
if isinstance(data, list):
|
||||
@@ -1530,7 +1530,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"PUT",
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
self.url + "/contents/" + urllib.quote(path),
|
||||
input=put_parameters
|
||||
)
|
||||
|
||||
@@ -1594,7 +1594,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"PUT",
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
self.url + "/contents/" + urllib.quote(path),
|
||||
input=put_parameters
|
||||
)
|
||||
|
||||
@@ -1644,7 +1644,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"DELETE",
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
self.url + "/contents/" + urllib.quote(path),
|
||||
input=url_parameters
|
||||
)
|
||||
|
||||
@@ -1665,7 +1665,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
url_parameters["ref"] = ref
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
self.url + "/contents/" + urllib.quote(path),
|
||||
parameters=url_parameters
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user