diff options
| author | Idan Gazit <idan@gazit.me> | 2012-04-11 13:09:32 +0300 |
|---|---|---|
| committer | Idan Gazit <idan@gazit.me> | 2012-04-11 13:09:32 +0300 |
| commit | 13215507f611abc3409d57e3910787bcf3b297c2 (patch) | |
| tree | 9864b489a5bb44b9e18b87f72fbd5e11323cad00 /tests/oauth2/draft25 | |
| parent | f76ada5e8223999e6fdcaa1cdb5055e3fb6ce750 (diff) | |
| download | oauthlib-13215507f611abc3409d57e3910787bcf3b297c2.tar.gz | |
PEP8 cleanup and fix OAuth2 import paths
Diffstat (limited to 'tests/oauth2/draft25')
| -rw-r--r-- | tests/oauth2/draft25/test_tokens.py | 2 | ||||
| -rw-r--r-- | tests/oauth2/draft25/test_utils.py | 17 |
2 files changed, 8 insertions, 11 deletions
diff --git a/tests/oauth2/draft25/test_tokens.py b/tests/oauth2/draft25/test_tokens.py index d5d3b51..098859c 100644 --- a/tests/oauth2/draft25/test_tokens.py +++ b/tests/oauth2/draft25/test_tokens.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -from ..unittest import TestCase +from ...unittest import TestCase from oauthlib.oauth2.draft25.tokens import * diff --git a/tests/oauth2/draft25/test_utils.py b/tests/oauth2/draft25/test_utils.py index 6622ad4..3844392 100644 --- a/tests/oauth2/draft25/test_utils.py +++ b/tests/oauth2/draft25/test_utils.py @@ -1,8 +1,8 @@ from __future__ import absolute_import -from ..unittest import TestCase +from ...unittest import TestCase -from oauthlib.oauth2_draft25.utils import * +from oauthlib.oauth2.draft25.utils import * class UtilsTests(TestCase): @@ -11,13 +11,13 @@ class UtilsTests(TestCase): """Assert that we are only escaping unicode""" self.assertRaises(ValueError, escape, "I am a string type. Not a unicode type.") self.assertEqual(escape(u"I am a unicode type."), u"I%20am%20a%20unicode%20type.") - + def test_generate_timestamp(self): """ TODO: Better test here """ timestamp = generate_timestamp() self.assertTrue(isinstance(timestamp, unicode)) self.assertTrue(int(timestamp)) - self.assertTrue(int(timestamp) > 1331672335) # is this increasing? + self.assertTrue(int(timestamp) > 1331672335) # is this increasing? def test_generate_nonce(self): """ TODO: better test here """ @@ -39,19 +39,16 @@ class UtilsTests(TestCase): def test_host_from_uri(self): """Test if hosts and ports are properly extracted from URIs. - - This should be done according to the MAC Authentication spec. + + This should be done according to the MAC Authentication spec. Defaults ports should be provided when none is present in the URI. """ self.assertEqual(host_from_uri(u'http://a.b-c.com:8080'), (u'a.b-c.com', u'8080')) self.assertEqual(host_from_uri(u'https://a.b.com:8080'), (u'a.b.com', u'8080')) self.assertEqual(host_from_uri(u'http://www.example.com'), (u'www.example.com', u'80')) self.assertEqual(host_from_uri(u'https://www.example.com'), (u'www.example.com', u'443')) - - def test_urlencode(self): """Ensure query components encoded properly""" self.assertEqual(urlencode([(u'hello', u' world')]), u'hello=%20world') - self.assertEqual(urlencode({u'hello' : u' world'}), u'hello=%20world') - + self.assertEqual(urlencode({u'hello': u' world'}), u'hello=%20world') |
