Consolidate handling of scopes.
Reviewed in https://codereview.appspot.com/6853060/.
diff --git a/tests/test_oauth2client_util.py b/tests/test_oauth2client_util.py
new file mode 100644
index 0000000..6c72521
--- /dev/null
+++ b/tests/test_oauth2client_util.py
@@ -0,0 +1,27 @@
+"""Unit tests for oauth2client.util."""
+
+__author__ = 'jcgregorio@google.com (Joe Gregorio)'
+
+import unittest
+
+from oauth2client import util
+
+
+class ScopeToStringTests(unittest.TestCase):
+
+ def test_iterables(self):
+ cases = [
+ ('', ''),
+ ('', ()),
+ ('', []),
+ ('', ('', )),
+ ('', ['', ]),
+ ('a', ('a', )),
+ ('b', ['b', ]),
+ ('a b', ['a', 'b']),
+ ('a b', ('a', 'b')),
+ ('a b', 'a b'),
+ ('a b', (s for s in ['a', 'b'])),
+ ]
+ for expected, case in cases:
+ self.assertEqual(expected, util.scopes_to_string(case))