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

Side by Side Diff: infra_libs/ts_mon/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: clean up code 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
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 from infra_libs.ts_mon.gae import distribution
8 8
9 9
10 class BucketerTestBase(unittest.TestCase): 10 class BucketerTestBase(unittest.TestCase):
11 def assertBucketCounts(self, b, expected_total): 11 def assertBucketCounts(self, b, expected_total):
12 self.assertEquals(expected_total - 2, b.num_finite_buckets) 12 self.assertEquals(expected_total - 2, b.num_finite_buckets)
13 self.assertEquals(expected_total, b.total_buckets) 13 self.assertEquals(expected_total, b.total_buckets)
14 self.assertEquals(0, b.underflow_bucket) 14 self.assertEquals(0, b.underflow_bucket)
15 self.assertEquals(expected_total - 1, b.overflow_bucket) 15 self.assertEquals(expected_total - 1, b.overflow_bucket)
16 16
17 def assertBoundaries(self, b, expected_finite_upper_boundaries): 17 def assertBoundaries(self, b, expected_finite_upper_boundaries):
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 self.assertEqual(100, d.sum) 156 self.assertEqual(100, d.sum)
157 self.assertEqual(1, d.count) 157 self.assertEqual(1, d.count)
158 self.assertEqual({11: 1}, d.buckets) 158 self.assertEqual({11: 1}, d.buckets)
159 159
160 d.add(1000000) 160 d.add(1000000)
161 161
162 self.assertEqual(1000100, d.sum) 162 self.assertEqual(1000100, d.sum)
163 self.assertEqual(2, d.count) 163 self.assertEqual(2, d.count)
164 self.assertEqual({11: 2}, d.buckets) 164 self.assertEqual({11: 2}, d.buckets)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698