diff options
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py')
-rw-r--r-- | Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py index 631f8d1..26c98c1 100644 --- a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py +++ b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py @@ -33,6 +33,7 @@ from webkitpy.common.system.filesystem_mock import MockFileSystem from webkitpy.common.system.outputcapture import OutputCapture from webkitpy.layout_tests.layout_package import test_results from webkitpy.layout_tests.layout_package import test_failures +from webkitpy.thirdparty.mock import Mock from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter from webkitpy.tool.mocktool import MockTool, MockStatusServer @@ -140,7 +141,15 @@ The dummy-queue is continuing to process your patch. """ test_results = [self._mock_test_result('foo/bar.html')] - OutputCapture().assert_outputs(self, reporter.report_flaky_tests, [test_results, patch], expected_stderr=expected_stderr) + + class MockZipFile(object): + def read(self, path): + return "" + + def namelist(self): + return ['foo/bar-diffs.txt'] + + OutputCapture().assert_outputs(self, reporter.report_flaky_tests, [patch, test_results, MockZipFile()], expected_stderr=expected_stderr) def test_optional_author_string(self): reporter = FlakyTestReporter(MockTool(), 'dummy-queue') @@ -150,6 +159,15 @@ The dummy-queue is continuing to process your patch. def test_results_diff_path_for_test(self): reporter = FlakyTestReporter(MockTool(), 'dummy-queue') - self.assertEqual(reporter._results_diff_path_for_test("test.html"), "/mock/test-diffs.txt") + self.assertEqual(reporter._results_diff_path_for_test("test.html"), "test-diffs.txt") + + def test_find_in_archive(self): + reporter = FlakyTestReporter(MockTool(), 'dummy-queue') + + class MockZipFile(object): + def namelist(self): + return ["tmp/layout-test-results/foo/bar-diffs.txt"] - # report_flaky_tests is also tested by queues_unittest + reporter._find_in_archive("foo/bar-diffs.txt", MockZipFile()) + # This is not ideal, but its + reporter._find_in_archive("txt", MockZipFile()) |