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.""" |
| 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 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') |
| 29 desc2 = LayoutTests.GetTestDescriptionFromSVN('jquery/data.html') |
| 30 self.assertEquals(desc2, 'UNKNOWN', 'Test description is wrong') |
| 31 |
| 32 def testGetParentDirectoryList(self): |
| 33 l = ['hoge1/hoge2/hoge3.html', 'hoge1/x.html', 'hoge1/hoge2/hoge4.html'] |
| 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 |