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

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

Issue 1313243003: [Telemetry] Introduce SummarizableValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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
Index: tools/telemetry/telemetry/value/histogram_unittest.py
diff --git a/tools/telemetry/telemetry/value/histogram_unittest.py b/tools/telemetry/telemetry/value/histogram_unittest.py
index f42507fd7b43576af21e32c63316f0fed20f3cb0..4e194e72c214b8171c001091bfeba24d76137342 100644
--- a/tools/telemetry/telemetry/value/histogram_unittest.py
+++ b/tools/telemetry/telemetry/value/histogram_unittest.py
@@ -8,6 +8,7 @@ from telemetry import story
from telemetry import page as page_module
from telemetry import value
from telemetry.value import histogram as histogram_module
+from telemetry.value import improvement_direction
class TestBase(unittest.TestCase):
@@ -31,7 +32,7 @@ class ValueTest(TestBase):
histogram = histogram_module.HistogramValue(
page0, 'x', 'counts',
raw_value_json='{"buckets": [{"low": 1, "high": 2, "count": 1}]}',
- important=False)
+ important=False, improvement_direction=improvement_direction.UP)
self.assertEquals(
['{"buckets": [{"low": 1, "high": 2, "count": 1}]}'],
histogram.GetBuildbotValue())
@@ -63,7 +64,7 @@ class ValueTest(TestBase):
histogram = histogram_module.HistogramValue(
None, 'x', 'counts',
raw_value_json='{"buckets": [{"low": 1, "high": 2, "count": 1}]}',
- important=False)
+ important=False, improvement_direction=improvement_direction.DOWN)
d = histogram.AsDictWithoutBaseClassEntries()
self.assertEquals(['buckets'], d.keys())
@@ -75,7 +76,8 @@ class ValueTest(TestBase):
'type': 'histogram',
'name': 'x',
'units': 'counts',
- 'buckets': [{'low': 1, 'high': 2, 'count': 1}]
+ 'buckets': [{'low': 1, 'high': 2, 'count': 1}],
+ 'improvement_direction': 'down',
}
v = value.Value.FromDict(d, {})
@@ -83,3 +85,4 @@ class ValueTest(TestBase):
self.assertEquals(
['{"buckets": [{"low": 1, "high": 2, "count": 1}]}'],
v.GetBuildbotValue())
+ self.assertEquals(improvement_direction.DOWN, v.improvement_direction)
« no previous file with comments | « tools/telemetry/telemetry/value/histogram.py ('k') | tools/telemetry/telemetry/value/improvement_direction.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698