Kuang-che Wu | b9705bd | 2018-06-28 17:59:18 +0800 | [diff] [blame^] | 1 | # -*- coding: utf-8 -*- |
| 2 | # Copyright 2018 The Chromium OS 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 | """Test eval_cros_autotest.py script""" |
| 6 | |
| 7 | from __future__ import print_function |
| 8 | import unittest |
| 9 | |
| 10 | from bisect_kit import testing |
| 11 | |
| 12 | import eval_cros_autotest |
| 13 | |
| 14 | |
| 15 | class TestEvalCrosAutotest(unittest.TestCase): |
| 16 | """Test eval_cros_autotest.""" |
| 17 | |
| 18 | def test_parse_test_report_log(self): |
| 19 | result = open(testing.get_testdata_path('test_report.log')).read() |
| 20 | self.assertEqual( |
| 21 | eval_cros_autotest.parse_test_report_log(result, |
| 22 | 'seconds_kernel_to_login'), |
| 23 | (True, [4.13, 4.08, 4.07, 4.11, 4.09, 4.0, 4.1, 4.07, 4.14, 4.1])) |
| 24 | |
| 25 | self.assertEqual( |
| 26 | eval_cros_autotest.parse_test_report_log(result, None), (True, None)) |
| 27 | |
| 28 | |
| 29 | if __name__ == '__main__': |
| 30 | unittest.main() |