예제 #1
0
 def test13ReturnsStdDevOddLengthNegative(self):
     myValues13 = values.Values([-2, -1, 0, 1, 2])
     self.assertAlmostEquals(1.58, myValues13.stdev(), 2, "")
     
 
     
예제 #2
0
 def test010ReturnsMedianOddList(self):
     myValues = values.Values([1,2,3])
     self.assertEquals(2,myValues.median())
예제 #3
0
 def test11ReturnsStdDevOddLengthPositive(self):
     myValues11 = values.Values([1, 2, 3, 4, 5])
     self.assertAlmostEqual(1.58, myValues11.stdev(), 2, "")
예제 #4
0
 def test12ReturnsStdDevEvenLengthNegative(self):
     myValues12 = values.Values([-1, 0, 1, 2])
     self.assertAlmostEqual(1.29, myValues12.stdev(), 2, "")
예제 #5
0
 def test09ReturnsPenultimateOddLength(self):
     myValues09 = values.Values([1, 2, 3, 4, 5])
     self.assertEquals(4, myValues09.penultimate())
예제 #6
0
 def test10ReturnsStdDevEvenLengthPositive(self):
     myValues10 = values.Values([1, 2, 3, 4])
     self.assertAlmostEqual(1.29, myValues10.stdev(), 2, "")
예제 #7
0
 def test07PenultimateException(self):
     myValues07 = values.Values([1])
     self.assertRaises(ValueError,myValues07.penultimate)
예제 #8
0
 def test08ReturnsPenultimateEvenLength(self):
     myValues08 = values.Values([1, 2, 3, 4])
     self.assertEquals(3, myValues08.penultimate())
예제 #9
0
 def test06ReturnsProductTripleNegative(self):
     myValues06 = values.Values([-2, -2, -2])
     self.assertEquals(-8, myValues06.product())
예제 #10
0
 def test05ReturnsProductNegativeNegative(self):
     myValues05 = values.Values([-2, -4])
     self.assertEquals(8, myValues05.product())
예제 #11
0
 def test04ReturnsProductNegativePositive(self):
     myValues04 = values.Values([-2, 4])
     self.assertEquals(-8, myValues04.product())        
예제 #12
0
 def test03ReturnsProductPositivePositive(self):
     myValues03 = values.Values([2, 4])
     self.assertEquals(8, myValues03.product())
예제 #13
0
 def test02ReturnsMedianEvenList(self):
     myValues02 = values.Values([1, 3, 2, 2])
     self.assertEquals(2,myValues02.median())