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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/third_party/coverage/tests/test_backward.py
diff --git a/tools/telemetry/third_party/coverage/tests/test_backward.py b/tools/telemetry/third_party/coverage/tests/test_backward.py
new file mode 100644
index 0000000000000000000000000000000000000000..fbb9ad8b45dff122a693f6d3f104388d149ffa95
--- /dev/null
+++ b/tools/telemetry/third_party/coverage/tests/test_backward.py
@@ -0,0 +1,23 @@
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+
+"""Tests that our version shims in backward.py are working."""
+
+from coverage.backunittest import TestCase
+from coverage.backward import iitems, binary_bytes, byte_to_int, bytes_to_ints
+
+
+class BackwardTest(TestCase):
+ """Tests of things from backward.py."""
+
+ def test_iitems(self):
+ d = {'a': 1, 'b': 2, 'c': 3}
+ items = [('a', 1), ('b', 2), ('c', 3)]
+ self.assertCountEqual(list(iitems(d)), items)
+
+ def test_binary_bytes(self):
+ byte_values = [0, 255, 17, 23, 42, 57]
+ bb = binary_bytes(byte_values)
+ self.assertEqual(len(bb), len(byte_values))
+ self.assertEqual(byte_values, list(bytes_to_ints(bb)))
+ self.assertEqual(byte_values, [byte_to_int(b) for b in bb])
« 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