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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_mock.py

Issue 2152663003: Refactor the buildbot module in webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 years, 5 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: third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_mock.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_mock.py
index 71cba9bd7b2ea951fc05d43beccfc6d2c767330a..568a70d4c7af9ac22174a70b008d56eb063e305b 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_mock.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_mock.py
@@ -26,49 +26,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import logging
-
+from webkitpy.common.net.buildbot import BuildBot
from webkitpy.common.net.layouttestresults import LayoutTestResults
-from webkitpy.common.net import layouttestresults_unittest
-
-_log = logging.getLogger(__name__)
-
-
-class MockBuild(object):
-
- def __init__(self, builder, build_number):
- self._builder = builder
- self._number = build_number
-
- def results_url(self):
- return "%s/%s" % (self._builder.results_url(), self._number)
-
-
-class MockBuilder(object):
+from webkitpy.common.net.layouttestresults_unittest import LayoutTestResultsTest
- def __init__(self, builder_name):
- self._name = builder_name
- def name(self):
- return self._name
-
- def build(self, build_number):
- return MockBuild(self, build_number=build_number)
-
- def results_url(self):
- return "http://example.com/builders/%s/results" % self.name()
-
- def latest_layout_test_results_url(self):
- return "http://example.com/f/builders/%s/results/layout-test-results" % self.name()
-
- def latest_layout_test_results(self):
- return self.fetch_layout_test_results(self.latest_layout_test_results_url())
+class MockBuildBot(BuildBot):
def fetch_layout_test_results(self, _):
- return LayoutTestResults.results_from_string(layouttestresults_unittest.LayoutTestResultsTest.example_full_results_json)
-
-
-class MockBuildBot(object):
-
- def builder_with_name(self, builder_name):
- return MockBuilder(builder_name)
+ return LayoutTestResults.results_from_string(LayoutTestResultsTest.example_full_results_json)

Powered by Google App Engine
This is Rietveld 408576698