OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2014 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 unittest |
| 7 |
| 8 from pylib.gtest import test_package |
| 9 |
| 10 # pylint: disable=W0212 |
| 11 |
| 12 |
| 13 class TestPackageTest(unittest.TestCase): |
| 14 |
| 15 def testParseGTestListTests_simple(self): |
| 16 raw_output = [ |
| 17 'TestCaseOne.', |
| 18 ' testOne', |
| 19 ' testTwo', |
| 20 'TestCaseTwo.', |
| 21 ' testThree', |
| 22 ' testFour', |
| 23 ] |
| 24 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 25 expected = [ |
| 26 'TestCaseOne.testOne', |
| 27 'TestCaseOne.testTwo', |
| 28 'TestCaseTwo.testThree', |
| 29 'TestCaseTwo.testFour', |
| 30 ] |
| 31 self.assertEqual(expected, actual) |
| 32 |
| 33 def testParseGTestListTests_parameterized_old(self): |
| 34 raw_output = [ |
| 35 'PTestCase.', |
| 36 ' testWithValueParam/0', |
| 37 ' testWithValueParam/1', |
| 38 ] |
| 39 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 40 expected = [ |
| 41 'PTestCase.testWithValueParam/0', |
| 42 'PTestCase.testWithValueParam/1', |
| 43 ] |
| 44 self.assertEqual(expected, actual) |
| 45 |
| 46 def testParseGTestListTests_parameterized_new(self): |
| 47 raw_output = [ |
| 48 'PTestCase.', |
| 49 ' testWithValueParam/0 # GetParam() = 0', |
| 50 ' testWithValueParam/1 # GetParam() = 1', |
| 51 ] |
| 52 actual = test_package.TestPackage._ParseGTestListTests(raw_output) |
| 53 expected = [ |
| 54 'PTestCase.testWithValueParam/0', |
| 55 'PTestCase.testWithValueParam/1', |
| 56 ] |
| 57 self.assertEqual(expected, actual) |
| 58 |
| 59 |
| 60 if __name__ == '__main__': |
| 61 unittest.main(verbosity=2) |
| 62 |
OLD | NEW |