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

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

Issue 914083005: [Telemetry] Fix 'important' field of certain Values being non-boolean (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits + make bots happy Created 5 years, 10 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/__init__.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 69e48d918c181b07f356c63a1445002fa18bab49..7c95571bbd827c9f45a8d243930e77cf31c555e1 100644
--- a/tools/telemetry/telemetry/value/value_unittest.py
+++ b/tools/telemetry/telemetry/value/value_unittest.py
@@ -91,6 +91,22 @@ class ValueTest(TestBase):
b = ValueForTest(page0, 'x', 'unit', important=True, description=None)
self.assertFalse(b.IsMergableWith(a))
+ def testNameMustBeString(self):
+ with self.assertRaises(ValueError):
+ value.Value(None, 42, 'unit', important=False, description=None)
+
+ def testUnitsMustBeString(self):
+ with self.assertRaises(ValueError):
+ value.Value(None, 'x', 42, important=False, description=None)
+
+ def testImportantMustBeBool(self):
+ with self.assertRaises(ValueError):
+ value.Value(None, 'x', 'unit', important='foo', description=None)
+
+ def testDescriptionMustBeStringOrNone(self):
+ with self.assertRaises(ValueError):
+ value.Value(None, 'x', 'unit', important=False, description=42)
+
def testAsDictBaseKeys(self):
v = ValueForAsDictTest(None, 'x', 'unit', important=True, description=None)
d = v.AsDict()
« 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