def test_normalization(self): '''test normalization''' m = ts.mean(self.nsample) s = ts.samplesd(self.nsample) res = [ts.normalize(x, m, s) for x in self.nsample] self.assertEqual(round(ts.mean(res)), self.nsampmean) self.assertEqual(round(ts.sd(res)), self.nsampdev)
def test_calc_valid_meanvalue_harmony(self): '''Test caluculate mean value by harmony''' time = 50 samples = ((time,50),(time,25)) result = ts.mean(samples, mode="harmony") self.assertEqual(result, 1.5)
def test_calc_valid_meanvalue_geom(self): '''Test caluculate mean value by geom''' result = ts.mean(self.samples, mode="geom") self.assertEqual(round(result,1), 8.8)
def test_calc_valid_meanvalue(self): '''Test caluculate mean value''' result = ts.mean(self.samples) self.assertEqual(result, self.x)
def test_devvalue(self): '''test deviation value''' m = ts.mean(self.nsample) s = ts.samplesd(self.nsample) res = ts.devvalue(self.nsample[0], m, s) self.assertEqual(round(res,1), self.devvx)