blob: 6c725210ab86a78b3b9908d18850f98dcf373ff3 [file] [log] [blame]
Joe Gregorio5cf5d122012-11-16 16:36:12 -05001"""Unit tests for oauth2client.util."""
2
3__author__ = 'jcgregorio@google.com (Joe Gregorio)'
4
5import unittest
6
7from oauth2client import util
8
9
10class 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))