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

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

Issue 2012963002: Add and clean up docstrings in webkitpy/w3c. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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_parser.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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 <link href="/resources/testharness.css" rel="stylesheet" type="text/css"> 142 <link href="/resources/testharness.css" rel="stylesheet" type="text/css">
143 <script src="/resources/testharness.js"></script> 143 <script src="/resources/testharness.js"></script>
144 </head> 144 </head>
145 """ 145 """
146 test_path = '/some/madeup/path/' 146 test_path = '/some/madeup/path/'
147 parser = TestParser(options, test_path + 'somefile.html') 147 parser = TestParser(options, test_path + 'somefile.html')
148 test_info = parser.analyze_test(test_contents=test_html) 148 test_info = parser.analyze_test(test_contents=test_html)
149 149
150 self.assertNotEqual(test_info, None, 'test_info is None') 150 self.assertNotEqual(test_info, None, 'test_info is None')
151 self.assertTrue('test' in test_info.keys(), 'did not find a test file') 151 self.assertTrue('test' in test_info.keys(), 'did not find a test file')
152 self.assertFalse('reference' in test_info.keys(), 'shold not have found a reference file') 152 self.assertFalse('reference' in test_info.keys(), 'should not have found a reference file')
153 self.assertFalse('refsupport' in test_info.keys(), 'there should be no r efsupport files for this test') 153 self.assertFalse('refsupport' in test_info.keys(), 'there should be no r efsupport files for this test')
154 self.assertTrue('jstest' in test_info.keys(), 'test should be a jstest') 154 self.assertTrue('jstest' in test_info.keys(), 'test should be a jstest')
155 155
156 def test_analyze_pixel_test_all_true(self): 156 def test_analyze_pixel_test_all_true(self):
157 """ Tests analyze_test() using a test that is neither a reftest or jstes t with all=False """ 157 """ Tests analyze_test() using a test that is neither a reftest or jstes t with all=False """
158 158
159 test_html = """<html> 159 test_html = """<html>
160 <head> 160 <head>
161 <title>CSS Test: DESCRIPTION OF TEST</title> 161 <title>CSS Test: DESCRIPTION OF TEST</title>
162 <link rel="author" title="NAME_OF_AUTHOR" /> 162 <link rel="author" title="NAME_OF_AUTHOR" />
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 test_info = parser.analyze_test(test_contents=test_html) 206 test_info = parser.analyze_test(test_contents=test_html)
207 207
208 self.assertEqual(test_info, None, 'test should have been skipped') 208 self.assertEqual(test_info, None, 'test should have been skipped')
209 209
210 def test_analyze_non_html_file(self): 210 def test_analyze_non_html_file(self):
211 """ Tests analyze_test() with a file that has no html""" 211 """ Tests analyze_test() with a file that has no html"""
212 # FIXME: use a mock filesystem 212 # FIXME: use a mock filesystem
213 parser = TestParser(options, os.path.join(os.path.dirname(__file__), 'te st_parser.py')) 213 parser = TestParser(options, os.path.join(os.path.dirname(__file__), 'te st_parser.py'))
214 test_info = parser.analyze_test() 214 test_info = parser.analyze_test()
215 self.assertEqual(test_info, None, 'no tests should have been found in th is file') 215 self.assertEqual(test_info, None, 'no tests should have been found in th is file')
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698