Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: tools/telemetry/third_party/gsutil/third_party/oauth2client/tests/test_util.py

Issue 1258583006: Add gsutil 4.13 to telemetry/third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo all other changes so this just add gsutil to third_party Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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))
28
29
30 class KeyConversionTests(unittest.TestCase):
31
32 def test_key_conversions(self):
33 d = {'somekey': 'some value', 'another': 'something else', 'onemore': 'foo'}
34 tuple_key = util.dict_to_tuple_key(d)
35
36 # the resulting key should be naturally sorted
37 self.assertEqual(
38 (('another', 'something else'),
39 ('onemore', 'foo'),
40 ('somekey', 'some value')),
41 tuple_key)
42
43 # check we get the original dictionary back
44 self.assertEqual(d, dict(tuple_key))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698