Mercurial > repos > yufei-luo > s_mart
diff commons/core/stat/test/Test_F_Stat.py @ 6:769e306b7933
Change the repository level.
author | yufei-luo |
---|---|
date | Fri, 18 Jan 2013 04:54:14 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commons/core/stat/test/Test_F_Stat.py Fri Jan 18 04:54:14 2013 -0500 @@ -0,0 +1,22 @@ +import unittest +from commons.core.stat.Stat import Stat + + +class Test_F_Stat(unittest.TestCase): + + + def test_output(self): + lValues = [0, -1, -5, 112, 10.2, 0.5, 4, -0.5] + iStat = Stat(lValues) + expString = "n=8 mean=15.025 var=1554.934 sd=39.433 min=-5.000 med=0.250 max=112.000" + self.assertEquals(expString, iStat.string()) + + def test_outputQuantile(self): + lValues = [0, -1, -5, 112, 10.2, 0.5, 4, -0.5] + iStat = Stat(lValues) + expString = "n=8 min=-5.000 Q1=-0.500 median=0.500 Q3=10.200 max=112.000" + self.assertEquals(expString, iStat.stringQuantiles()) + + +if __name__ == "__main__": + unittest.main() \ No newline at end of file