Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: telemetry/telemetry/internal/results/valueset_output_formatter_unittest.py

Issue 2556213002: Revert of Replace ValueSetOutputFormatter with HistogramSetJsonOutputFormatter. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « telemetry/telemetry/internal/results/valueset_output_formatter.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 import json
5 import os
6 import tempfile
7 import unittest
8
9 from telemetry.internal.results import valueset_output_formatter
10 from telemetry.internal.results import page_test_results
11
12
13 class ValueSetOutputFormatterTest(unittest.TestCase):
14
15 def setUp(self):
16 self.output_file_path = tempfile.mkstemp()[1]
17
18 def tearDown(self):
19 try:
20 os.remove(self.output_file_path)
21 except OSError:
22 pass
23
24 def test_basic_summary(self):
25 sample = {
26 'name': 'a',
27 'guid': '42',
28 'description': 'desc',
29 'important': False,
30 'diagnostics': [],
31 'type': 'numeric',
32 'numeric': {
33 'unit': 'n%',
34 'type': 'scalar',
35 'value': 42
36 }
37 }
38
39 results = page_test_results.PageTestResults()
40 results.value_set.extend([sample])
41
42 with open(self.output_file_path, 'w') as output_file:
43 formatter = valueset_output_formatter.ValueSetOutputFormatter(output_file)
44 formatter.Format(results)
45
46 written_data = json.load(open(self.output_file_path))
47 self.assertEqual([sample], written_data)
48
OLDNEW
« no previous file with comments | « telemetry/telemetry/internal/results/valueset_output_formatter.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698