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

Side by Side Diff: dashboard/dashboard/pinpoint/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
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 import unittest
6
7 from dashboard.pinpoint import mann_whitney_u
8
9
10 class MannWhitneyUTest(unittest.TestCase):
11 def testBasic(self):
12 self.assertAlmostEqual(
13 mann_whitney_u.MannWhitneyU(range(10), range(20, 30)),
14 0.00018267179110955002)
15 self.assertAlmostEqual(
16 mann_whitney_u.MannWhitneyU(range(5), range(10)),
17 0.13986357686781267)
18
19 def testDuplicateValues(self):
20 self.assertAlmostEqual(mann_whitney_u.MannWhitneyU([0] * 5, [1] * 5),
21 0.0039767517097886512)
22
23 def testSmallSamples(self):
24 self.assertEqual(mann_whitney_u.MannWhitneyU([0], [1]), 1.0)
25
26 def testAllValuesIdentical(self):
27 with self.assertRaises(ValueError):
28 mann_whitney_u.MannWhitneyU([0] * 5, [0] * 5)
29
30
31 if __name__ == '__main__':
32 unittest.main()
OLDNEW
« no previous file with comments | « dashboard/dashboard/pinpoint/mann_whitney_u.py ('k') | dashboard/dashboard/pinpoint/models/job.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698