Index: tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py |
diff --git a/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py b/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py |
index 4f1e0c130c7076dc5b5cc3a220c59d029696b8d2..9b7ed7133b015aae16b5edde36941463119b39be 100644 |
--- a/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py |
+++ b/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py |
@@ -9,6 +9,7 @@ from telemetry import page as page_module |
from telemetry.page import page_set |
from telemetry.results import csv_pivot_table_output_formatter |
from telemetry.results import page_test_results |
+from telemetry.value import improvement_direction |
from telemetry.value import scalar |
@@ -57,7 +58,9 @@ class CsvPivotTableOutputFormatterTest(unittest.TestCase): |
def testSimple(self): |
# Test a simple benchmark with only one value: |
self.SimulateBenchmarkRun({ |
- self._page_set[0]: [scalar.ScalarValue(None, 'foo', 'seconds', 3)]}) |
+ self._page_set[0]: [scalar.ScalarValue( |
+ None, 'foo', 'seconds', 3, |
+ improvement_direction=improvement_direction.DOWN)]}) |
expected = self._LINE_SEPARATOR.join([ |
'page_set,page,name,value,units,run_index', |
'page_set,http://www.foo.com/,foo,3,seconds,0', |
@@ -67,10 +70,20 @@ class CsvPivotTableOutputFormatterTest(unittest.TestCase): |
def testMultiplePagesAndValues(self): |
self.SimulateBenchmarkRun({ |
- self._page_set[0]: [scalar.ScalarValue(None, 'foo', 'seconds', 4)], |
- self._page_set[1]: [scalar.ScalarValue(None, 'foo', 'seconds', 3.4), |
- scalar.ScalarValue(None, 'bar', 'km', 10), |
- scalar.ScalarValue(None, 'baz', 'count', 5)]}) |
+ self._page_set[0]: [ |
+ scalar.ScalarValue( |
+ None, 'foo', 'seconds', 4, |
+ improvement_direction=improvement_direction.DOWN)], |
+ self._page_set[1]: [ |
+ scalar.ScalarValue( |
+ None, 'foo', 'seconds', 3.4, |
+ improvement_direction=improvement_direction.DOWN), |
+ scalar.ScalarValue( |
+ None, 'bar', 'km', 10, |
+ improvement_direction=improvement_direction.DOWN), |
+ scalar.ScalarValue( |
+ None, 'baz', 'count', 5, |
+ improvement_direction=improvement_direction.DOWN)]}) |
# Parse CSV output into list of lists. |
csv_string = self.Format() |
@@ -84,8 +97,13 @@ class CsvPivotTableOutputFormatterTest(unittest.TestCase): |
def testTraceTag(self): |
self.MakeFormatter(trace_tag='date,option') |
self.SimulateBenchmarkRun({ |
- self._page_set[0]: [scalar.ScalarValue(None, 'foo', 'seconds', 3), |
- scalar.ScalarValue(None, 'bar', 'tons', 5)]}) |
+ self._page_set[0]: [ |
+ scalar.ScalarValue( |
+ None, 'foo', 'seconds', 3, |
+ improvement_direction=improvement_direction.DOWN), |
+ scalar.ScalarValue( |
+ None, 'bar', 'tons', 5, |
+ improvement_direction=improvement_direction.DOWN)]}) |
output = self.Format().split(self._LINE_SEPARATOR) |
self.assertTrue(output[0].endswith(',trace_tag_0,trace_tag_1')) |