Index: tools/telemetry/telemetry/unittest/run_tests.py |
diff --git a/tools/telemetry/telemetry/unittest/run_tests.py b/tools/telemetry/telemetry/unittest/run_tests.py |
index 92c2c336d826f75e26680660317e7f91b92515f7..1223e33d9dc97352aa973cf5e80259dd6d3f54cc 100644 |
--- a/tools/telemetry/telemetry/unittest/run_tests.py |
+++ b/tools/telemetry/telemetry/unittest/run_tests.py |
@@ -2,8 +2,11 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import json |
import logging |
+import StringIO |
import unittest |
+import urllib2 |
from telemetry import decorators |
from telemetry.core import browser_finder |
@@ -110,6 +113,16 @@ def RestoreLoggingLevel(func): |
config = None |
+# pylint: disable=W0613 |
+def stuburlopen(url): |
+ assert not hasattr(stuburlopen, 'called') |
+ setattr(stuburlopen, 'called', 1) |
+ return StringIO.StringIO(json.dumps({'builders':{ |
+ 'android_nexus4_perf_bisect': 'stuff', |
+ 'mac_10_9_perf_bisect': 'otherstuff', |
+ 'win_perf_bisect_builder': 'not a trybot', |
+ }})) |
+ |
class RunTestsCommand(command_line.OptparseCommand): |
"""Run unit tests""" |
@@ -205,4 +218,5 @@ class RunTestsCommand(command_line.OptparseCommand): |
@classmethod |
@RestoreLoggingLevel |
def main(cls, args=None): |
+ urllib2.urlopen = stuburlopen |
return super(RunTestsCommand, cls).main(args) |
sullivan
2014/08/15 14:58:37
There's one big problem with this CL: the unit tes
|