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

Side by Side 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, 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 of coverage/python.py"""
5
6 import os
7 import sys
8
9 from coverage.python import get_zip_bytes
10
11 from tests.coveragetest import CoverageTest
12
13
14 class GetZipBytesTest(CoverageTest):
15 """Tests of `get_zip_bytes`."""
16
17 run_in_temp_dir = False
18
19 def test_get_encoded_zip_files(self):
20 # See igor.py, do_zipmods, for the text of these files.
21 zip_file = "tests/zipmods.zip"
22 sys.path.append(zip_file) # So we can import the files.
23 for encoding in ["utf8", "gb2312", "hebrew", "shift_jis"]:
24 filename = zip_file + "/encoded_" + encoding + ".py"
25 filename = filename.replace("/", os.sep)
26 zip_data = get_zip_bytes(filename)
27 zip_text = zip_data.decode(encoding)
28 self.assertIn('All OK', zip_text)
29 # Run the code to see that we really got it encoded properly.
30 __import__("encoded_"+encoding)
OLDNEW
« 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