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

Unified Diff: tools/telemetry/telemetry/value/value_unittest.py

Issue 399893003: Add "description" attribute to Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix calls to Value constructor so that the tests pass. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/value/string.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/value/value_unittest.py
diff --git a/tools/telemetry/telemetry/value/value_unittest.py b/tools/telemetry/telemetry/value/value_unittest.py
index 15b568cb10899044918f5a7fdd3d0eceb0bbbc3c..a7ea0a116b52f099c7411fd905e2fab9f2fc7b8d 100644
--- a/tools/telemetry/telemetry/value/value_unittest.py
+++ b/tools/telemetry/telemetry/value/value_unittest.py
@@ -58,27 +58,28 @@ class ValueTest(TestBase):
page0 = self.pages[0]
page1 = self.pages[0]
- a = value.Value(page0, 'x', 'unit', important=False)
- b = value.Value(page1, 'x', 'unit', important=False)
+ a = value.Value(page0, 'x', 'unit', important=False, description=None)
+ b = value.Value(page1, 'x', 'unit', important=False, description=None)
self.assertTrue(b.IsMergableWith(a))
def testIncompat(self):
page0 = self.pages[0]
- a = value.Value(page0, 'x', 'unit', important=False)
- b = value.Value(page0, 'x', 'incompatUnit', important=False)
+ a = value.Value(page0, 'x', 'unit', important=False, description=None)
+ b = value.Value(page0, 'x', 'incompatUnit', important=False,
+ description=None)
self.assertFalse(b.IsMergableWith(a))
- a = value.Value(page0, 'x', 'unit', important=False)
- b = value.Value(page0, 'x', 'unit', important=True)
+ a = value.Value(page0, 'x', 'unit', important=False, description=None)
+ b = value.Value(page0, 'x', 'unit', important=True, description=None)
self.assertFalse(b.IsMergableWith(a))
- a = value.Value(page0, 'x', 'unit', important=False)
- b = ValueForTest(page0, 'x', 'unit', important=True)
+ a = value.Value(page0, 'x', 'unit', important=False, description=None)
+ b = ValueForTest(page0, 'x', 'unit', important=True, description=None)
self.assertFalse(b.IsMergableWith(a))
def testAsDictBaseKeys(self):
- v = ValueForAsDictTest(None, 'x', 'unit', important=True)
+ v = ValueForAsDictTest(None, 'x', 'unit', important=True, description=None)
d = v.AsDict()
self.assertEquals(d, {
@@ -90,14 +91,24 @@ class ValueTest(TestBase):
def testAsDictWithPage(self):
page0 = self.pages[0]
- v = ValueForAsDictTest(page0, 'x', 'unit', important=False)
+ v = ValueForAsDictTest(page0, 'x', 'unit', important=False,
+ description=None)
d = v.AsDict()
self.assertIn('page_id', d)
-
def testAsDictWithoutPage(self):
- v = ValueForAsDictTest(None, 'x', 'unit', important=False)
+ v = ValueForAsDictTest(None, 'x', 'unit', important=False, description=None)
d = v.AsDict()
self.assertNotIn('page_id', d)
+
+ def testAsDictWithDescription(self):
+ v = ValueForAsDictTest(None, 'x', 'unit', important=False,
+ description='Some description.')
+ d = v.AsDict()
+ self.assertEqual('Some description.', d['description'])
+
+ def testAsDictWithoutDescription(self):
+ v = ValueForAsDictTest(None, 'x', 'unit', important=False, description=None)
+ self.assertNotIn('description', v.AsDict())
« no previous file with comments | « tools/telemetry/telemetry/value/string.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698