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

Side by Side Diff: infra_libs/ts_mon/common/test/distribution_test.py

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: add noncululativedistribution metric to ts_mon imports 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 unified diff | Download patch
« no previous file with comments | « infra_libs/ts_mon/common/test/__init__.py ('k') | infra_libs/ts_mon/common/test/errors_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 from infra_libs.ts_mon import distribution 7 try:
8 from infra_libs.ts_mon.common import distribution
9 except ImportError: # pragma: no cover
10 from common import distribution
8 11
9 12
10 class BucketerTestBase(unittest.TestCase): 13 class BucketerTestBase(unittest.TestCase):
11 def assertBucketCounts(self, b, expected_total): 14 def assertBucketCounts(self, b, expected_total):
12 self.assertEquals(expected_total - 2, b.num_finite_buckets) 15 self.assertEquals(expected_total - 2, b.num_finite_buckets)
13 self.assertEquals(expected_total, b.total_buckets) 16 self.assertEquals(expected_total, b.total_buckets)
14 self.assertEquals(0, b.underflow_bucket) 17 self.assertEquals(0, b.underflow_bucket)
15 self.assertEquals(expected_total - 1, b.overflow_bucket) 18 self.assertEquals(expected_total - 1, b.overflow_bucket)
16 19
17 def assertBoundaries(self, b, expected_finite_upper_boundaries): 20 def assertBoundaries(self, b, expected_finite_upper_boundaries):
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 158
156 self.assertEqual(100, d.sum) 159 self.assertEqual(100, d.sum)
157 self.assertEqual(1, d.count) 160 self.assertEqual(1, d.count)
158 self.assertEqual({11: 1}, d.buckets) 161 self.assertEqual({11: 1}, d.buckets)
159 162
160 d.add(1000000) 163 d.add(1000000)
161 164
162 self.assertEqual(1000100, d.sum) 165 self.assertEqual(1000100, d.sum)
163 self.assertEqual(2, d.count) 166 self.assertEqual(2, d.count)
164 self.assertEqual({11: 2}, d.buckets) 167 self.assertEqual({11: 2}, d.buckets)
OLDNEW
« no previous file with comments | « infra_libs/ts_mon/common/test/__init__.py ('k') | infra_libs/ts_mon/common/test/errors_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698