2 # Copyright (c) 2012 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.
10 from trend_graph
import TrendGraph
13 class TestTrendGraph(unittest
.TestCase
):
16 test_graph_file_backup_path
= os
.path
.join('test_data', 'graph.html.bak')
17 test_graph_file_path
= os
.path
.join('test_data', 'graph.html')
18 shutil
.copyfile(test_graph_file_backup_path
, test_graph_file_path
)
19 trend_graph
= TrendGraph(test_graph_file_path
)
21 data_map
['whole'] = (['test1'], 'undefined', 'undefined')
22 data_map
['skip'] = (['test1', 'test2'], 'undefined', 'undefined')
23 data_map
['nonskip'] = (['test1', 'test2', 'test3'], 'undefined',
25 data_map
['passingrate'] = (str(4), 'undefined', 'undefined')
27 trend_graph
.Update('2008,1,1,13,45,00', data_map
)
28 # Assert the result graph from the file.
29 f
= open(test_graph_file_path
)
30 lines2
= f
.readlines()
34 if '2008,0,1,13,45,00' in line
:
36 self
.assertEqual(line_count
, 2)
39 if __name__
== '__main__':