summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Falcão <gabriel@nacaolivre.org>2013-10-27 19:10:17 -0700
committerGabriel Falcão <gabriel@nacaolivre.org>2013-10-27 19:10:17 -0700
commitd4bb2ee7c3ccd1fc03100729f83f8f7784b26638 (patch)
treedccff7015c80d0ffe7074c54af34a8de5aa64980
parentb5827151ddde2e3fed49f5a1ca7f2bb2ef8876a1 (diff)
parent85820bc6b4714118f4b1feee3e010e87e8356446 (diff)
downloadhttpretty-d4bb2ee7c3ccd1fc03100729f83f8f7784b26638.tar.gz
Merge pull request #120 from aukaost/master
Replaced dynamic module attributes with actual references
-rw-r--r--httpretty/__init__.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/httpretty/__init__.py b/httpretty/__init__.py
index 1d7b8a6..8b54ce2 100644
--- a/httpretty/__init__.py
+++ b/httpretty/__init__.py
@@ -27,8 +27,6 @@ from __future__ import unicode_literals
__version__ = version = '0.7.0'
-import sys
-
from .core import httpretty, httprettified
from .errors import HTTPrettyError
from .core import URIInfo
@@ -36,10 +34,21 @@ from .core import URIInfo
HTTPretty = httpretty
activate = httprettified
-SELF = sys.modules[__name__]
-
-for attr in [name.decode() for name in httpretty.METHODS] + ['register_uri', 'enable', 'disable', 'is_enabled', 'reset', 'Response']:
- setattr(SELF, attr, getattr(httpretty, attr))
+enable = httpretty.enable
+register_uri = httpretty.register_uri
+disable = httpretty.disable
+is_enabled = httpretty.is_enabled
+reset = httpretty.reset
+Response = httpretty.Response
+
+GET = httpretty.GET
+PUT = httpretty.PUT
+POST = httpretty.POST
+DELETE = httpretty.DELETE
+HEAD = httpretty.HEAD
+PATCH = httpretty.PATCH
+OPTIONS = httpretty.OPTIONS
+CONNECT = httpretty.CONNECT
def last_request():