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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_unittest.py

Issue 2786013003: Remove usage of TestParser from test_copier.py. (Closed)
Patch Set: Rebase Created 3 years, 8 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 | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.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 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 6 #
7 # 1. Redistributions of source code must retain the above 7 # 1. Redistributions of source code must retain the above
8 # copyright notice, this list of conditions and the following 8 # copyright notice, this list of conditions and the following
9 # disclaimer. 9 # disclaimer.
10 # 2. Redistributions in binary form must reproduce the above 10 # 2. Redistributions in binary form must reproduce the above
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 copier.find_importable_tests() 61 copier.find_importable_tests()
62 self.assertEqual( 62 self.assertEqual(
63 copier.import_list, 63 copier.import_list,
64 [ 64 [
65 { 65 {
66 'copy_list': [ 66 'copy_list': [
67 {'dest': 'has_shebang.txt', 'src': '/blink/w3c/dir/has_s hebang.txt'}, 67 {'dest': 'has_shebang.txt', 'src': '/blink/w3c/dir/has_s hebang.txt'},
68 {'dest': 'README.txt', 'src': '/blink/w3c/dir/README.txt '} 68 {'dest': 'README.txt', 'src': '/blink/w3c/dir/README.txt '}
69 ], 69 ],
70 'dirname': '/blink/w3c/dir', 70 'dirname': '/blink/w3c/dir',
71 'jstests': 0,
72 'reftests': 0,
73 'total_tests': 0,
74 } 71 }
75 ]) 72 ])
76 73
77 def test_does_not_import_reftestlist_file(self): 74 def test_does_not_import_reftestlist_file(self):
78 host = MockHost() 75 host = MockHost()
79 host.filesystem = MockFileSystem(files=FAKE_FILES) 76 host.filesystem = MockFileSystem(files=FAKE_FILES)
80 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR) 77 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
81 copier.find_importable_tests() 78 copier.find_importable_tests()
82 self.assertEqual( 79 self.assertEqual(
83 copier.import_list, 80 copier.import_list,
84 [ 81 [
85 { 82 {
86 'copy_list': [ 83 'copy_list': [
87 {'dest': 'has_shebang.txt', 'src': '/blink/w3c/dir/has_s hebang.txt'}, 84 {'dest': 'has_shebang.txt', 'src': '/blink/w3c/dir/has_s hebang.txt'},
88 {'dest': 'README.txt', 'src': '/blink/w3c/dir/README.txt '} 85 {'dest': 'README.txt', 'src': '/blink/w3c/dir/README.txt '}
89 ], 86 ],
90 'dirname': '/blink/w3c/dir', 87 'dirname': '/blink/w3c/dir',
91 'jstests': 0,
92 'reftests': 0,
93 'total_tests': 0,
94 } 88 }
95 ]) 89 ])
96 90
97 def test_files_with_shebang_are_made_executable(self): 91 def test_files_with_shebang_are_made_executable(self):
98 host = MockHost() 92 host = MockHost()
99 host.filesystem = MockFileSystem(files=FAKE_FILES) 93 host.filesystem = MockFileSystem(files=FAKE_FILES)
100 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR) 94 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
101 copier.do_import() 95 copier.do_import()
102 self.assertEqual( 96 self.assertEqual(
103 host.filesystem.executable_files, 97 host.filesystem.executable_files,
(...skipping 10 matching lines...) Expand all
114 copier.find_importable_tests() 108 copier.find_importable_tests()
115 self.assertEqual( 109 self.assertEqual(
116 copier.import_list, 110 copier.import_list,
117 [ 111 [
118 { 112 {
119 'copy_list': [ 113 'copy_list': [
120 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'ref-fi le.html'}, 114 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'ref-fi le.html'},
121 {'src': '/blink/w3c/dir1/my-ref-test.html', 'dest': 'my- ref-test.html'} 115 {'src': '/blink/w3c/dir1/my-ref-test.html', 'dest': 'my- ref-test.html'}
122 ], 116 ],
123 'dirname': '/blink/w3c/dir1', 117 'dirname': '/blink/w3c/dir1',
124 'jstests': 0,
125 'reftests': 1,
126 'total_tests': 1
127 } 118 }
128 ]) 119 ])
129
130 def test_ref_test_without_ref_is_skipped(self):
131 host = MockHost()
132 host.filesystem = MockFileSystem(files={
133 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h ref="not-here.html" /></head></html>',
134 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '',
135 })
136 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
137 copier.find_importable_tests()
138 self.assertEqual(copier.import_list, [])
139 self.assertLog([
140 'WARNING: Skipping: /blink/w3c/dir1/my-ref-test.html\n',
141 'WARNING: Reason: Ref file "/blink/w3c/dir1/not-here.html" was not found.\n'
142 ])
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698