| OLD | NEW |
| 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 Loading... |
| 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) |
| OLD | NEW |