OLD | NEW |
1 #!/usr/bin/env python | |
2 | |
3 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
4 # | 2 # |
5 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
7 # are met: | 5 # are met: |
8 # | 6 # |
9 # 1. Redistributions of source code must retain the above | 7 # 1. Redistributions of source code must retain the above |
10 # copyright notice, this list of conditions and the following | 8 # copyright notice, this list of conditions and the following |
11 # disclaimer. | 9 # disclaimer. |
12 # 2. Redistributions in binary form must reproduce the above | 10 # 2. Redistributions in binary form must reproduce the above |
13 # copyright notice, this list of conditions and the following | 11 # copyright notice, this list of conditions and the following |
14 # disclaimer in the documentation and/or other materials | 12 # disclaimer in the documentation and/or other materials |
15 # provided with the distribution. | 13 # provided with the distribution. |
16 # | 14 # |
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY | 15 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY |
18 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 16 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
20 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE | 18 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE |
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, | 19 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
22 # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 20 # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
23 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 21 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
24 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 22 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 23 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
26 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 24 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
27 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 # SUCH DAMAGE. | 26 # SUCH DAMAGE. |
29 | 27 |
30 import os | 28 import os |
31 import webkitpy.thirdparty.unittest2 as unittest | 29 import unittest |
32 | 30 |
33 from webkitpy.common.system.outputcapture import OutputCapture | 31 from webkitpy.common.system.outputcapture import OutputCapture |
34 from webkitpy.w3c.test_parser import TestParser | 32 from webkitpy.w3c.test_parser import TestParser |
35 | 33 |
36 | 34 |
37 options = {'all': False, 'no_overwrite': False} | 35 options = {'all': False, 'no_overwrite': False} |
38 | 36 |
39 | 37 |
40 class TestParserTest(unittest.TestCase): | 38 class TestParserTest(unittest.TestCase): |
41 | 39 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 test_info = parser.analyze_test(test_contents=test_html) | 206 test_info = parser.analyze_test(test_contents=test_html) |
209 | 207 |
210 self.assertEqual(test_info, None, 'test should have been skipped') | 208 self.assertEqual(test_info, None, 'test should have been skipped') |
211 | 209 |
212 def test_analyze_non_html_file(self): | 210 def test_analyze_non_html_file(self): |
213 """ Tests analyze_test() with a file that has no html""" | 211 """ Tests analyze_test() with a file that has no html""" |
214 # FIXME: use a mock filesystem | 212 # FIXME: use a mock filesystem |
215 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')) |
216 test_info = parser.analyze_test() | 214 test_info = parser.analyze_test() |
217 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') |
OLD | NEW |