blob: 7cac6de8c227fc08f6b0fc6a4b7a3effeadf872c [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):
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
29if __name__ == '__main__':
30 unittest.main()