diff options
Diffstat (limited to 'tests/oauth2/draft25/test_utils.py')
-rw-r--r-- | tests/oauth2/draft25/test_utils.py | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/tests/oauth2/draft25/test_utils.py b/tests/oauth2/draft25/test_utils.py index 3844392..c526891 100644 --- a/tests/oauth2/draft25/test_utils.py +++ b/tests/oauth2/draft25/test_utils.py @@ -1,8 +1,7 @@ from __future__ import absolute_import from ...unittest import TestCase - -from oauthlib.oauth2.draft25.utils import * +from oauthlib.oauth2.draft25.utils import escape, host_from_uri class UtilsTests(TestCase): @@ -12,31 +11,6 @@ class UtilsTests(TestCase): 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? - - def test_generate_nonce(self): - """ TODO: better test here """ - nonce = generate_nonce() - for i in range(50): - self.assertTrue(nonce != generate_nonce()) - - def test_generate_token(self): - """ TODO: better test here""" - token = generate_token() - self.assertEqual(len(token), 20) - - token = generate_token(length=44) - self.assertEqual(len(token), 44) - - token = generate_token(length=6, chars="python") - self.assertEqual(len(token), 6) - self.assertTrue("a" not in token) - def test_host_from_uri(self): """Test if hosts and ports are properly extracted from URIs. @@ -47,8 +21,3 @@ class UtilsTests(TestCase): 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') |