blob: 6185512622afd04bce7d059fed2799ff21f7c2e8 [file] [log] [blame]
Kuang-che Wub9705bd2018-06-28 17:59:18 +08001# -*- 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
7from __future__ import print_function
8import unittest
9
10from bisect_kit import testing
11
12import eval_cros_autotest
13
14
15class TestEvalCrosAutotest(unittest.TestCase):
16 """Test eval_cros_autotest."""
17
18 def test_parse_test_report_log(self):
Kuang-che Wua5723492019-11-25 20:59:34 +080019 with open(testing.get_testdata_path('test_report.log')) as f:
20 result = f.read()
Kuang-che Wub9705bd2018-06-28 17:59:18 +080021 self.assertEqual(
22 eval_cros_autotest.parse_test_report_log(result,
23 'seconds_kernel_to_login'),
24 (True, [4.13, 4.08, 4.07, 4.11, 4.09, 4.0, 4.1, 4.07, 4.14, 4.1]))
25
26 self.assertEqual(
27 eval_cros_autotest.parse_test_report_log(result, None), (True, None))
28
Kuang-che Wub9705bd2018-06-28 17:59:18 +080029
30if __name__ == '__main__':
31 unittest.main()