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

Side by Side Diff: tools/telemetry/telemetry/value/value_unittest.py

Issue 541253002: [Telemetry] Add 'important' to JSON output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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 | « tools/telemetry/telemetry/value/__init__.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
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import os 4 import os
5 import unittest 5 import unittest
6 6
7 from telemetry import value 7 from telemetry import value
8 from telemetry.page import page_set 8 from telemetry.page import page_set
9 9
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 self.assertFalse(b.IsMergableWith(a)) 90 self.assertFalse(b.IsMergableWith(a))
91 91
92 def testAsDictBaseKeys(self): 92 def testAsDictBaseKeys(self):
93 v = ValueForAsDictTest(None, 'x', 'unit', important=True, description=None) 93 v = ValueForAsDictTest(None, 'x', 'unit', important=True, description=None)
94 d = v.AsDict() 94 d = v.AsDict()
95 95
96 self.assertEquals(d, { 96 self.assertEquals(d, {
97 'name': 'x', 97 'name': 'x',
98 'type': 'baz', 98 'type': 'baz',
99 'units': 'unit', 99 'units': 'unit',
100 'important': True
100 }) 101 })
101 102
102 def testAsDictWithPage(self): 103 def testAsDictWithPage(self):
103 page0 = self.pages[0] 104 page0 = self.pages[0]
104 105
105 v = ValueForAsDictTest(page0, 'x', 'unit', important=False, 106 v = ValueForAsDictTest(page0, 'x', 'unit', important=False,
106 description=None) 107 description=None)
107 d = v.AsDict() 108 d = v.AsDict()
108 109
109 self.assertIn('page_id', d) 110 self.assertIn('page_id', d)
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 'units': 'unit' 191 'units': 'unit'
191 } 192 }
192 d1 = { 193 d1 = {
193 'type': 'value_for_from_dict_test', 194 'type': 'value_for_from_dict_test',
194 'name': 'y', 195 'name': 'y',
195 'units': 'unit' 196 'units': 'unit'
196 } 197 }
197 vs = value.Value.ListOfValuesFromListOfDicts([d0, d1], {}) 198 vs = value.Value.ListOfValuesFromListOfDicts([d0, d1], {})
198 self.assertEquals(vs[0].name, 'x') 199 self.assertEquals(vs[0].name, 'x')
199 self.assertEquals(vs[1].name, 'y') 200 self.assertEquals(vs[1].name, 'y')
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/value/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698