6
|
1 import unittest
|
|
2 from commons.core.stat.Stat import Stat
|
|
3
|
|
4
|
|
5 class Test_F_Stat(unittest.TestCase):
|
|
6
|
|
7
|
|
8 def test_output(self):
|
|
9 lValues = [0, -1, -5, 112, 10.2, 0.5, 4, -0.5]
|
|
10 iStat = Stat(lValues)
|
|
11 expString = "n=8 mean=15.025 var=1554.934 sd=39.433 min=-5.000 med=0.250 max=112.000"
|
|
12 self.assertEquals(expString, iStat.string())
|
|
13
|
|
14 def test_outputQuantile(self):
|
|
15 lValues = [0, -1, -5, 112, 10.2, 0.5, 4, -0.5]
|
|
16 iStat = Stat(lValues)
|
|
17 expString = "n=8 min=-5.000 Q1=-0.500 median=0.500 Q3=10.200 max=112.000"
|
|
18 self.assertEquals(expString, iStat.stringQuantiles())
|
|
19
|
|
20
|
|
21 if __name__ == "__main__":
|
|
22 unittest.main() |