Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pretend should work for all except get reuqest type

  • Loading branch information...
commit e098f9d0098bf0d1f215a25511da553af8184178 1 parent b8cb123
@garbas authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 githubcollective/github.py
View
12 githubcollective/github.py
@@ -33,8 +33,6 @@ def __init__(self, organization, username, password, verbose, pretend):
# requests library helpers
def _request(self, method, url, data=None):
- if self.pretend:
- return
kw = {'url': BASE_URL+url+'?per_page=10000',
'headers': self.headers}
if data:
@@ -58,15 +56,23 @@ def _get_request(self, url):
return json.load(self._request(requests.get, url))
def _delete_request(self, url):
+ if self.pretend:
+ return
return self._request(requests.delete, url)
def _post_request(self, url, data):
- return json.load(self._request(requests.post, url, data))
+ if self.pretend:
+ return
+ return self._request(requests.post, url, data)
def _put_request(self, url):
+ if self.pretend:
+ return
return self._request(requests.put, url)
def _patch_request(self, url, data):
+ if self.pretend:
+ return
return self._request(requests.patch, url, data)
#
Please sign in to comment.
Something went wrong with that request. Please try again.