OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/python | |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 import os | |
7 import unittest | |
8 | |
9 from layouttests import LayoutTests | |
10 from test_expectations import TestExpectations | |
11 | |
12 | |
13 class TestLayoutTests(unittest.TestCase): | |
14 """Unit tests for the LayoutTests class.""" | |
15 | |
16 def testJoinWithTestExpectation(self): | |
17 layouttests = LayoutTests(csv_file_path=os.path.join('testname', | |
18 'media.csv')) | |
19 test_expectations = TestExpectations() | |
20 test_info_map = layouttests.JoinWithTestExpectation(test_expectations) | |
21 | |
22 mediaTestInResult = False | |
dennis_jeffrey
2011/08/26 19:01:26
Remove this line; this variable is unused.
imasaki1
2011/08/26 22:28:44
Done.
| |
23 self.assertTrue(any(['media/' in k for k in test_info_map.keys()]), | |
24 msg=('Analyzer result should contain at least one ' | |
25 'media test cases since we only retrieved media ' | |
dennis_jeffrey
2011/08/26 19:01:26
Rather than asserting we find at least one media t
imasaki1
2011/08/26 22:28:44
I agree but, Currently, test expectation file is d
| |
26 'related test')) | |
27 | |
28 def testGetTestDescriptionsFromSVN(self): | |
29 desc1 = LayoutTests.GetTestDescriptionFromSVN( | |
30 'media/track/track-webvtt-tc004-magicheader.html') | |
31 self.assertEquals(desc1, | |
32 ('Tests that the magic file header "WEBVTT" leads to the' | |
33 ' file properly recognized as a WebVTT file.'), | |
34 msg='Extracted test description is wrong') | |
35 desc2 = LayoutTests.GetTestDescriptionFromSVN('jquery/data.html') | |
36 self.assertEquals(desc2, 'UNKNOWN', | |
37 msg='Extracted test description is wrong') | |
38 | |
39 def testGetParentDirectoryList(self): | |
40 testname_list = ['hoge1/hoge2/hoge3.html', 'hoge1/x.html', | |
41 'hoge1/hoge2/hoge4.html'] | |
42 expected_result = ['hoge1/', 'hoge1/hoge2/'] | |
43 self.assertEquals(LayoutTests.GetParentDirectoryList(testname_list), | |
44 expected_result) | |
45 | |
46 | |
47 if __name__ == '__main__': | |
48 unittest.main() | |
OLD | NEW |