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

Side by Side Diff: tools/telemetry/third_party/coverage/tests/test_backward.py

Issue 1366913004: Add coverage Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
3
4 """Tests that our version shims in backward.py are working."""
5
6 from coverage.backunittest import TestCase
7 from coverage.backward import iitems, binary_bytes, byte_to_int, bytes_to_ints
8
9
10 class BackwardTest(TestCase):
11 """Tests of things from backward.py."""
12
13 def test_iitems(self):
14 d = {'a': 1, 'b': 2, 'c': 3}
15 items = [('a', 1), ('b', 2), ('c', 3)]
16 self.assertCountEqual(list(iitems(d)), items)
17
18 def test_binary_bytes(self):
19 byte_values = [0, 255, 17, 23, 42, 57]
20 bb = binary_bytes(byte_values)
21 self.assertEqual(len(bb), len(byte_values))
22 self.assertEqual(byte_values, list(bytes_to_ints(bb)))
23 self.assertEqual(byte_values, [byte_to_int(b) for b in bb])
OLDNEW
« no previous file with comments | « tools/telemetry/third_party/coverage/tests/test_arcs.py ('k') | tools/telemetry/third_party/coverage/tests/test_cmdline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698