Chromium Code Reviews| Index: infra_libs/ts_mon/common/test/metrics_test.py |
| diff --git a/infra_libs/ts_mon/common/test/metrics_test.py b/infra_libs/ts_mon/common/test/metrics_test.py |
| index b064caf0a92849cd07992c491b66e7d300c7a51c..3b0e0bb6d0fcd882dbb66c192a03cb77dc8ef069 100644 |
| --- a/infra_libs/ts_mon/common/test/metrics_test.py |
| +++ b/infra_libs/ts_mon/common/test/metrics_test.py |
| @@ -62,6 +62,15 @@ class MetricTest(TestBase): |
| m.serialize_to(p, 1234, (('bar', 1), ('baz', False)), m.get(), t) |
| return str(p).splitlines() |
| + def test_serialize_with_units(self): |
| + t = targets.DeviceTarget('reg', 'role', 'net', 'host') |
| + m = metrics.GaugeMetric('test', units=metrics.MetricsDataUnits.SECONDS) |
| + m.set(1) |
| + p = metrics_pb2.MetricsCollection() |
| + m.serialize_to(p, 1234, (('bar', 1), ('baz', False)), m.get(), t) |
| + self.assertEquals(p.data[0].units, metrics.MetricsDataUnits.SECONDS) |
| + return str(p).splitlines() |
|
Sergey Berezin
2016/06/30 19:21:26
It seems you're missing the new expectations file
ddoman
2016/07/06 03:35:37
Done.
|
| + |
| def test_serialize_too_many_fields(self): |
| m = metrics.StringMetric('test', fields={'a': 1, 'b': 2, 'c': 3, 'd': 4}) |
| m.set('val', fields={'e': 5, 'f': 6, 'g': 7}) |