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

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

Issue 2291193004: In update-w3c-test-expectations, handle non-existent/non-test files. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py » ('j') | 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 CONTENT OF TEST 194 CONTENT OF TEST
195 </body> 195 </body>
196 </html> 196 </html>
197 """ 197 """
198 # Set 'all' to False so this gets skipped. 198 # Set 'all' to False so this gets skipped.
199 options = {'all': False} 199 options = {'all': False}
200 200
201 test_path = '/some/madeup/path/' 201 test_path = '/some/madeup/path/'
202 parser = TestParser(test_path + 'somefile.html', MockHost(), options) 202 parser = TestParser(test_path + 'somefile.html', MockHost(), options)
203 test_info = parser.analyze_test(test_contents=test_html) 203 test_info = parser.analyze_test(test_contents=test_html)
204
205 self.assertEqual(test_info, None, 'test should have been skipped') 204 self.assertEqual(test_info, None, 'test should have been skipped')
206 205
207 def test_analyze_non_html_file(self): 206 def test_analyze_non_html_file(self):
208 """ Tests analyze_test() with a file that has no html""" 207 """ Tests analyze_test() with a file that has no html"""
209 # FIXME: use a mock filesystem 208 # FIXME: use a mock filesystem
210 parser = TestParser(os.path.join(os.path.dirname(__file__), 'test_parser .py'), MockHost()) 209 parser = TestParser(os.path.join(os.path.dirname(__file__), 'test_parser .py'), MockHost())
211 test_info = parser.analyze_test() 210 test_info = parser.analyze_test()
212 self.assertEqual(test_info, None, 'no tests should have been found in th is file') 211 self.assertEqual(test_info, None, 'no tests should have been found in th is file')
212
213 def test_parser_initialization_non_existent_file(self):
214 parser = TestParser('some/bogus/path.html', MockHost())
215 self.assertEqual(parser.filename, 'some/bogus/path.html')
216 self.assertIsNone(parser.test_doc)
217 self.assertIsNone(parser.ref_doc)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698