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

Side by Side Diff: dashboard/dashboard/pinpoint/models/mann_whitney_u_test.py

Issue 3019503002: [pinpoint] Move mann_whitney_u.py to models/ (Closed)
Patch Set: Created 3 years, 3 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 | « dashboard/dashboard/pinpoint/models/mann_whitney_u.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 dashboard.pinpoint import mann_whitney_u 7 from dashboard.pinpoint.models import mann_whitney_u
8 8
9 9
10 class MannWhitneyUTest(unittest.TestCase): 10 class MannWhitneyUTest(unittest.TestCase):
11 def testBasic(self): 11 def testBasic(self):
12 self.assertAlmostEqual( 12 self.assertAlmostEqual(
13 mann_whitney_u.MannWhitneyU(range(10), range(20, 30)), 13 mann_whitney_u.MannWhitneyU(range(10), range(20, 30)),
14 0.00018267179110955002) 14 0.00018267179110955002)
15 self.assertAlmostEqual( 15 self.assertAlmostEqual(
16 mann_whitney_u.MannWhitneyU(range(5), range(10)), 16 mann_whitney_u.MannWhitneyU(range(5), range(10)),
17 0.13986357686781267) 17 0.13986357686781267)
18 18
19 def testDuplicateValues(self): 19 def testDuplicateValues(self):
20 self.assertAlmostEqual(mann_whitney_u.MannWhitneyU([0] * 5, [1] * 5), 20 self.assertAlmostEqual(mann_whitney_u.MannWhitneyU([0] * 5, [1] * 5),
21 0.0039767517097886512) 21 0.0039767517097886512)
22 22
23 def testSmallSamples(self): 23 def testSmallSamples(self):
24 self.assertEqual(mann_whitney_u.MannWhitneyU([0], [1]), 1.0) 24 self.assertEqual(mann_whitney_u.MannWhitneyU([0], [1]), 1.0)
25 25
26 def testAllValuesIdentical(self): 26 def testAllValuesIdentical(self):
27 with self.assertRaises(ValueError): 27 with self.assertRaises(ValueError):
28 mann_whitney_u.MannWhitneyU([0] * 5, [0] * 5) 28 mann_whitney_u.MannWhitneyU([0] * 5, [0] * 5)
29 29
30 30
31 if __name__ == '__main__': 31 if __name__ == '__main__':
32 unittest.main() 32 unittest.main()
OLDNEW
« no previous file with comments | « dashboard/dashboard/pinpoint/models/mann_whitney_u.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698