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

Unified Diff: tools/telemetry/third_party/coverage/tests/test_python.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_python.py
diff --git a/tools/telemetry/third_party/coverage/tests/test_python.py b/tools/telemetry/third_party/coverage/tests/test_python.py
new file mode 100644
index 0000000000000000000000000000000000000000..e510e7863b77e9d3f0a50cdbaaf0a6c6892ef89f
--- /dev/null
+++ b/tools/telemetry/third_party/coverage/tests/test_python.py
@@ -0,0 +1,30 @@
+# 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 of coverage/python.py"""
+
+import os
+import sys
+
+from coverage.python import get_zip_bytes
+
+from tests.coveragetest import CoverageTest
+
+
+class GetZipBytesTest(CoverageTest):
+ """Tests of `get_zip_bytes`."""
+
+ run_in_temp_dir = False
+
+ def test_get_encoded_zip_files(self):
+ # See igor.py, do_zipmods, for the text of these files.
+ zip_file = "tests/zipmods.zip"
+ sys.path.append(zip_file) # So we can import the files.
+ for encoding in ["utf8", "gb2312", "hebrew", "shift_jis"]:
+ filename = zip_file + "/encoded_" + encoding + ".py"
+ filename = filename.replace("/", os.sep)
+ zip_data = get_zip_bytes(filename)
+ zip_text = zip_data.decode(encoding)
+ self.assertIn('All OK', zip_text)
+ # Run the code to see that we really got it encoded properly.
+ __import__("encoded_"+encoding)
« no previous file with comments | « tools/telemetry/third_party/coverage/tests/test_process.py ('k') | tools/telemetry/third_party/coverage/tests/test_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698