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

Unified Diff: tools/perf/fetch_benchmark_deps_unittest.py

Issue 2914843002: Refactor fetch_benchmark_deps.py script to allow fetching all benchmark deps (Closed)
Patch Set: update Created 3 years, 7 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
« no previous file with comments | « tools/perf/fetch_benchmark_deps.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/fetch_benchmark_deps_unittest.py
diff --git a/tools/perf/fetch_benchmark_deps_unittest.py b/tools/perf/fetch_benchmark_deps_unittest.py
index 12ead09c54f9e60ec3d713b72533f677be2bd14f..96ccfe9f4265e3c947b17cae299a5364868f630c 100644
--- a/tools/perf/fetch_benchmark_deps_unittest.py
+++ b/tools/perf/fetch_benchmark_deps_unittest.py
@@ -3,7 +3,6 @@
# found in the LICENSE file.
import os
-import sys
import unittest
import StringIO
@@ -25,11 +24,6 @@ class FetchBenchmarkDepsUnittest(unittest.TestCase):
py_utils.cloud_storage.GetFilesInDirectoryIfChanged
"""
- def setUp(self):
- """Override sys.argv as if it is called from command line."""
- self._argv = sys.argv
- sys.argv = ['./fetch_benchmark_deps', '']
-
def _RunFetchBenchmarkDepsTest(self, benchmark_name,
expected_fetched_file_paths=None):
"""Simulates './fetch_benchmark_deps [benchmark_name]'
@@ -42,7 +36,7 @@ class FetchBenchmarkDepsUnittest(unittest.TestCase):
benchmark_name: benchmark name
expected_fetched_file_paths: the expected result.
"""
- sys.argv[1] = benchmark_name
+ args = [benchmark_name]
output = StringIO.StringIO()
with mock.patch('telemetry.wpr.archive_info.WprArchiveInfo'
'.DownloadArchivesIfNeeded') as mock_download:
@@ -50,7 +44,7 @@ class FetchBenchmarkDepsUnittest(unittest.TestCase):
'.GetFilesInDirectoryIfChanged') as mock_get:
mock_download.return_value = True
mock_get.GetFilesInDirectoryIfChanged.return_value = True
- fetch_benchmark_deps.main(output)
+ fetch_benchmark_deps.main(args, output)
for f in output.getvalue().splitlines():
fullpath = os.path.join(path_util.GetChromiumSrcDir(), f)
sha1path = fullpath + '.sha1'
« no previous file with comments | « tools/perf/fetch_benchmark_deps.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698