OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import unittest |
| 6 |
| 7 from pylib.gtest import test_package |
| 8 |
| 9 |
| 10 class TestPackageTest(unittest.TestCase): |
| 11 |
| 12 def testParseGTestListTests_simple(self): |
| 13 raw_output = [ |
| 14 'TestCaseOne.', |
| 15 ' testOne', |
| 16 ' testTwo', |
| 17 'TestCaseTwo.', |
| 18 ' testThree', |
| 19 ' testFour', |
| 20 ] |
| 21 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 22 expected = [ |
| 23 'TestCaseOne.testOne', |
| 24 'TestCaseOne.testTwo', |
| 25 'TestCaseTwo.testThree', |
| 26 'TestCaseTwo.testFour', |
| 27 ] |
| 28 self.assertEqual(expected, actual) |
| 29 |
| 30 def testParseGTestListTests_parameterized_old(self): |
| 31 raw_output = [ |
| 32 'PTestCase.', |
| 33 ' testWithValueParam/0', |
| 34 ' testWithValueParam/1', |
| 35 ] |
| 36 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 37 expected = [ |
| 38 'PTestCase.testWithValueParam/0', |
| 39 'PTestCase.testWithValueParam/1', |
| 40 ] |
| 41 self.assertEqual(expected, actual) |
| 42 |
| 43 def testParseGTestListTests_parameterized_new(self): |
| 44 raw_output = [ |
| 45 'PTestCase.', |
| 46 ' testWithValueParam/0 # GetParam() = 0', |
| 47 ' testWithValueParam/1 # GetParam() = 1', |
| 48 ] |
| 49 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 50 expected = [ |
| 51 'PTestCase.testWithValueParam/0', |
| 52 'PTestCase.testWithValueParam/1', |
| 53 ] |
| 54 self.assertEqual(expected, actual) |
| 55 |
| 56 |
| 57 if __name__ == '__main__': |
| 58 unittest.main(verbosity=2) |
| 59 |
OLD | NEW |