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

Unified Diff: tools/telemetry/telemetry/value/__init__.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/perf/measurements/v8_gc_times.py ('k') | tools/telemetry/telemetry/value/value_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/value/__init__.py
diff --git a/tools/telemetry/telemetry/value/__init__.py b/tools/telemetry/telemetry/value/__init__.py
index c4330ecdd92c5da1a3b24217ed9d5e43b2840694..d38199858e560e6df749a5f23f5fda48ebf9ccf9 100644
--- a/tools/telemetry/telemetry/value/__init__.py
+++ b/tools/telemetry/telemetry/value/__init__.py
@@ -57,6 +57,16 @@ class Value(object):
description: A string explaining in human-understandable terms what this
value represents.
"""
+ # TODO(eakuefner): Check user story here after migration (crbug.com/442036)
+ if not isinstance(name, basestring):
+ raise ValueError('name field of Value must be string.')
+ if not isinstance(units, basestring):
+ raise ValueError('units field of Value must be string.')
+ if not isinstance(important, bool):
+ raise ValueError('important field of Value must be bool.')
+ if not ((description is None) or isinstance(description, basestring)):
+ raise ValueError('description field of Value must absent or string.')
+
self.page = page
self.name = name
self.units = units
« no previous file with comments | « tools/perf/measurements/v8_gc_times.py ('k') | tools/telemetry/telemetry/value/value_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698