Joe Gregorio | 5cf5d12 | 2012-11-16 16:36:12 -0500 | [diff] [blame^] | 1 | """Unit tests for oauth2client.util.""" |
| 2 | |
| 3 | __author__ = 'jcgregorio@google.com (Joe Gregorio)' |
| 4 | |
| 5 | import unittest |
| 6 | |
| 7 | from oauth2client import util |
| 8 | |
| 9 | |
| 10 | class ScopeToStringTests(unittest.TestCase): |
| 11 | |
| 12 | def test_iterables(self): |
| 13 | cases = [ |
| 14 | ('', ''), |
| 15 | ('', ()), |
| 16 | ('', []), |
| 17 | ('', ('', )), |
| 18 | ('', ['', ]), |
| 19 | ('a', ('a', )), |
| 20 | ('b', ['b', ]), |
| 21 | ('a b', ['a', 'b']), |
| 22 | ('a b', ('a', 'b')), |
| 23 | ('a b', 'a b'), |
| 24 | ('a b', (s for s in ['a', 'b'])), |
| 25 | ] |
| 26 | for expected, case in cases: |
| 27 | self.assertEqual(expected, util.scopes_to_string(case)) |