move tests over
authorKenneth Reitz <me@kennethreitz.com>
Wed, 15 Feb 2012 07:52:12 +0000 (02:52 -0500)
committerKenneth Reitz <me@kennethreitz.com>
Wed, 15 Feb 2012 07:52:32 +0000 (02:52 -0500)
Makefile
tests/test_requests.py [moved from test_requests.py with 99% similarity]
tests/test_requests_async.py [moved from test_requests_async.py with 92% similarity]
tests/test_requests_ext.py [moved from test_requests_ext.py with 93% similarity]

index b3a673e..bc34ea2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ init:
        pip install -r requirements.txt
 
 test:
-       nosetests --with-color ./test_*
+       nosetests --with-color ./tests/*
 
 lazy:
        nosetests --with-color test_requests.py
similarity index 99%
rename from test_requests.py
rename to tests/test_requests.py
index d290c20..76df752 100755 (executable)
@@ -1,6 +1,12 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
+# from __future__ import unicode_literals
+
+# Path hack.
+import sys, os
+sys.path.insert(0, os.path.abspath('..'))
+
 import io
 import json
 import time
similarity index 92%
rename from test_requests_async.py
rename to tests/test_requests_async.py
index 8e62e8c..2d37bbb 100644 (file)
@@ -1,6 +1,10 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
+# Path hack.
+import sys, os
+sys.path.insert(0, os.path.abspath('..'))
+
 import sys
 import unittest
 
@@ -16,18 +20,18 @@ class RequestsTestSuiteUsingAsyncApi(RequestsTestSuite):
 
     def patched(f):
         """Automatically send request after creation."""
-    
+
         def wrapped(*args, **kwargs):
-    
+
             request = f(*args, **kwargs)
             return async.map([request])[0]
-    
+
         return wrapped
 
     # Patched requests.api functions.
     global request
     request = patched(async.request)
-    
+
     global delete, get, head, options, patch, post, put
     delete = patched(async.delete)
     get = patched(async.get)
@@ -41,18 +45,18 @@ class RequestsTestSuiteUsingAsyncApi(RequestsTestSuite):
     def test_entry_points(self):
 
         async.request
-        
-        async.delete 
+
+        async.delete
         async.get
         async.head
         async.options
         async.patch
         async.post
         async.put
-        
+
         async.map
         async.send
-       
+
 
 if __name__ == '__main__':
     unittest.main()
similarity index 93%
rename from test_requests_ext.py
rename to tests/test_requests_ext.py
index 8df101e..4d40fa3 100644 (file)
@@ -1,7 +1,9 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-from __future__ import with_statement
+# Path hack.
+import sys, os
+sys.path.insert(0, os.path.abspath('..'))
 
 import unittest