Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

pretend should work for all except get reuqest type

  • Loading branch information...
commit e098f9d0098bf0d1f215a25511da553af8184178 1 parent b8cb123
Rok Garbas authored July 03, 2011

Showing 1 changed file with 9 additions and 3 deletions. Show diff stats Hide diff stats

  1. 12  githubcollective/github.py
12  githubcollective/github.py
@@ -33,8 +33,6 @@ def __init__(self, organization, username, password, verbose, pretend):
33 33
     # requests library helpers
34 34
 
35 35
     def _request(self, method, url, data=None):
36  
-        if self.pretend:
37  
-            return
38 36
         kw = {'url': BASE_URL+url+'?per_page=10000',
39 37
               'headers': self.headers}
40 38
         if data:
@@ -58,15 +56,23 @@ def _get_request(self, url):
58 56
         return json.load(self._request(requests.get, url))
59 57
 
60 58
     def _delete_request(self, url):
  59
+        if self.pretend:
  60
+            return
61 61
         return self._request(requests.delete, url)
62 62
 
63 63
     def _post_request(self, url, data):
64  
-        return json.load(self._request(requests.post, url, data))
  64
+        if self.pretend:
  65
+            return
  66
+        return self._request(requests.post, url, data)
65 67
 
66 68
     def _put_request(self, url):
  69
+        if self.pretend:
  70
+            return
67 71
         return self._request(requests.put, url)
68 72
 
69 73
     def _patch_request(self, url, data):
  74
+        if self.pretend:
  75
+            return
70 76
         return self._request(requests.patch, url, data)
71 77
 
72 78
     #

0 notes on commit e098f9d

Please sign in to comment.
Something went wrong with that request. Please try again.