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

Unified Diff: Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py

Issue 307183002: Teach webkit-patch update-flaky-tests how to upload a change (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't need MockTool Created 6 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/Scripts/webkitpy/tool/commands/flakytests.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
diff --git a/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py b/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..a602557ba3c25730518470ca40a74eac79098cb1
--- /dev/null
+++ b/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
@@ -0,0 +1,35 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.mocktool import MockTool, MockOptions
+
+import flakytests
+
+
+class FakeBotTestExpectations(object):
+ def expectation_lines(self, only_ignore_very_flaky=False):
+ return []
+
+
+class FakeBotTestExpectationsFactory(object):
+ def expectations_for_port(self, port_name):
+ return FakeBotTestExpectations()
+
+
+class FlakyTestsTest(CommandsTest):
+ def test_simple(self):
+ command = flakytests.FlakyTests()
+ factory = FakeBotTestExpectationsFactory()
+ lines = command._collect_expectation_lines(['foo'], factory)
+ self.assertEqual(lines, [])
+
+ def test_integration(self):
+ command = flakytests.FlakyTests()
+ command.expectations_factory = FakeBotTestExpectationsFactory
+ options = MockOptions(upload=True)
+ expected_stdout = """Updated /mock-checkout/third_party/WebKit/LayoutTests/FlakyTests
+LayoutTests/FlakyTests is not changed, not uploading.
+"""
+ self.assert_execute_outputs(command, options=options, expected_stdout=expected_stdout)
« no previous file with comments | « Tools/Scripts/webkitpy/tool/commands/flakytests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698