|
Lines 53-58
class TestParserTest(unittest.TestCase):
a/Tools/Scripts/webkitpy/w3c/test_parser_unittest.py_sec1
|
| 53 |
self.assertTrue('test' in test_info.keys(), 'did not find a test file') |
53 |
self.assertTrue('test' in test_info.keys(), 'did not find a test file') |
| 54 |
self.assertTrue('reference' in test_info.keys(), 'did not find a reference file') |
54 |
self.assertTrue('reference' in test_info.keys(), 'did not find a reference file') |
| 55 |
self.assertTrue(test_info['reference'].startswith(test_path), 'reference path is not correct') |
55 |
self.assertTrue(test_info['reference'].startswith(test_path), 'reference path is not correct') |
|
|
56 |
self.assertTrue('type' in test_info.keys(), 'did not find a reference type') |
| 57 |
self.assertEqual(test_info['type'], 'match', 'reference type is not correct') |
| 58 |
self.assertFalse('refsupport' in test_info.keys(), 'there should be no refsupport files for this test') |
| 59 |
self.assertFalse('jstest' in test_info.keys(), 'test should not have been analyzed as a jstest') |
| 60 |
|
| 61 |
def test_analyze_test_reftest_one_mismatch(self): |
| 62 |
test_html = """<head> |
| 63 |
<link rel="mismatch" href="green-box-ref.xht" /> |
| 64 |
</head> |
| 65 |
""" |
| 66 |
test_path = os.path.join(os.path.sep, 'some', 'madeup', 'path') |
| 67 |
parser = TestParser(options, os.path.join(test_path, 'somefile.html')) |
| 68 |
test_info = parser.analyze_test(test_contents=test_html) |
| 69 |
|
| 70 |
self.assertNotEqual(test_info, None, 'did not find a test') |
| 71 |
self.assertTrue('test' in test_info.keys(), 'did not find a test file') |
| 72 |
self.assertTrue('reference' in test_info.keys(), 'did not find a reference file') |
| 73 |
self.assertTrue(test_info['reference'].startswith(test_path), 'reference path is not correct') |
| 74 |
self.assertTrue('type' in test_info.keys(), 'did not find a reference type') |
| 75 |
self.assertEqual(test_info['type'], 'mismatch', 'reference type is not correct') |
| 56 |
self.assertFalse('refsupport' in test_info.keys(), 'there should be no refsupport files for this test') |
76 |
self.assertFalse('refsupport' in test_info.keys(), 'there should be no refsupport files for this test') |
| 57 |
self.assertFalse('jstest' in test_info.keys(), 'test should not have been analyzed as a jstest') |
77 |
self.assertFalse('jstest' in test_info.keys(), 'test should not have been analyzed as a jstest') |
| 58 |
|
78 |
|