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 """A class for unittest for layouttests class.""" | |
dennis_jeffrey
2011/08/25 00:36:46
'Unit tests for the LayoutTests class.'
imasaki1
2011/08/25 23:57:03
Done.
| |
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) | |
dennis_jeffrey
2011/08/25 00:36:46
any verification that should be done in this test?
imasaki1
2011/08/25 23:57:03
Done.
| |
21 | |
22 def testGetTestDescriptionsFromSVN(self): | |
23 desc1 = LayoutTests.GetTestDescriptionFromSVN( | |
24 'media/track/track-webvtt-tc004-magicheader.html') | |
25 self.assertEquals(desc1, | |
26 ('Tests that the magic file header "WEBVTT" leads to the' | |
27 ' file properly recognized as a WebVTT file.'), | |
28 'Test description is wrong') | |
dennis_jeffrey
2011/08/25 00:36:46
nit: indent the above 3 lines by 1 more space each
imasaki1
2011/08/25 23:57:03
Done.
| |
29 desc2 = LayoutTests.GetTestDescriptionFromSVN('jquery/data.html') | |
30 self.assertEquals(desc2, 'UNKNOWN', 'Test description is wrong') | |
dennis_jeffrey
2011/08/25 00:36:46
msg='Test description is wrong'
imasaki1
2011/08/25 23:57:03
Done.
| |
31 | |
32 def testGetParentDirectoryList(self): | |
33 l = ['hoge1/hoge2/hoge3.html', 'hoge1/x.html', 'hoge1/hoge2/hoge4.html'] | |
dennis_jeffrey
2011/08/25 00:36:46
recommend a more descriptive variable name than 'l
imasaki1
2011/08/25 23:57:03
Done.
| |
34 expected_result = ['hoge1/', 'hoge1/hoge2/'] | |
35 assertEquals(LayoutTests.GetParentDirectoryList(l), | |
36 expected_result) | |
37 | |
38 | |
39 if __name__ == '__main__': | |
40 unittest.main() | |
OLD | NEW |