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

Side by Side Diff: scripts/slave/chromium/archive_layout_test_results_unittest.py

Issue 2429573002: Also archive diff files in layout-test-results.zip. (Closed)
Patch Set: Rebased Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « scripts/slave/chromium/archive_layout_test_results.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import sys 7 import sys
8 import unittest 8 import unittest
9 9
10 BASE_DIR = os.path.join( 10 BASE_DIR = os.path.join(
11 os.path.dirname(os.path.abspath(__file__)), '..', '..', '..') 11 os.path.dirname(os.path.abspath(__file__)), '..', '..', '..')
12 sys.path.append(os.path.join(BASE_DIR, 'scripts')) 12 sys.path.append(os.path.join(BASE_DIR, 'scripts'))
13 sys.path.append(os.path.join(BASE_DIR, 'site_config')) 13 sys.path.append(os.path.join(BASE_DIR, 'site_config'))
14 14
15 from slave.chromium import archive_layout_test_results 15 from slave.chromium import archive_layout_test_results as archive_module
16 16
17 17
18 class ArchiveLayoutTestResultsTest(unittest.TestCase): 18 class ArchiveLayoutTestResultsTest(unittest.TestCase):
19 19
20 def test_IsActualResultFile(self): 20 def testIsIncludedInZipArchiveFilesCrashLogs(self):
21 self.assertTrue(archive_layout_test_results._IsActualResultFile( 21 self.assertTrue(archive_module._IsIncludedInZipArchive('foo-crash-log.txt'))
22 'foo-crash-log.txt')) 22 self.assertTrue(archive_module._IsIncludedInZipArchive('foo-stack.txt'))
23 self.assertTrue(archive_layout_test_results._IsActualResultFile(
24 'foo-stack.txt'))
25 23
26 self.assertFalse(archive_layout_test_results._IsActualResultFile( 24 def testIsIncludedInZipArchiveFilesNonCrashLogFiles(self):
27 'crash-logging-foo.txt')) 25 self.assertFalse(archive_module._IsIncludedInZipArchive('crashlog-foo.txt'))
28 self.assertFalse(archive_layout_test_results._IsActualResultFile( 26 self.assertFalse(archive_module._IsIncludedInZipArchive('stack-foo.txt'))
29 'stack-foo.txt'))
30 27
31 self.assertTrue(archive_layout_test_results._IsActualResultFile( 28 def testIsIncludedInZipArchiveFilesActualFiles(self):
32 'foo-actual.txt')) 29 self.assertTrue(archive_module._IsIncludedInZipArchive('foo-actual.txt'))
33 self.assertTrue(archive_layout_test_results._IsActualResultFile( 30 self.assertTrue(archive_module._IsIncludedInZipArchive('foo-actual.png'))
34 'foo-actual.png'))
35 31
36 self.assertFalse(archive_layout_test_results._IsActualResultFile( 32 def testIsIncludedInZipArchiveFilesActualFilesWrongExtension(self):
37 'foo-actual.jpg')) 33 self.assertFalse(archive_module._IsIncludedInZipArchive('foo-actual.jpg'))
38 self.assertFalse(archive_layout_test_results._IsActualResultFile( 34 self.assertFalse(archive_module._IsIncludedInZipArchive('foo-actual.html'))
39 'foo-actual.html')) 35
36 def testIsIncludedInZipArchiveFilesExpectedFiles(self):
37 self.assertTrue(archive_module._IsIncludedInZipArchive('a-expected.txt'))
38 self.assertTrue(archive_module._IsIncludedInZipArchive('a-expected.html'))
39
40 def testIsIncludedInZipArchiveFilesDiffFiles(self):
41 self.assertTrue(archive_module._IsIncludedInZipArchive('a-diff.png'))
42 self.assertTrue(archive_module._IsIncludedInZipArchive('a-diff.txt'))
43 self.assertTrue(archive_module._IsIncludedInZipArchive('a-wdiff.txt'))
44 self.assertFalse(archive_module._IsIncludedInZipArchive('a-diff.png.foo'))
45
46 def testIsIncludedInZipArchiveFilesOtherNegativeCases(self):
47 self.assertFalse(archive_module._IsIncludedInZipArchive('results.html'))
48 self.assertFalse(archive_module._IsIncludedInZipArchive('my-test.html'))
49
50 def testIsIncludedInZipArchiveFilesJson(self):
51 self.assertTrue(archive_module._IsIncludedInZipArchive('results.json'))
40 52
41 53
42 if __name__ == '__main__': 54 if __name__ == '__main__':
43 unittest.main() 55 unittest.main()
OLDNEW
« no previous file with comments | « scripts/slave/chromium/archive_layout_test_results.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698