| 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)
|
|
|