Exemplo n.º 1
0
 def test600_080ShouldCalculateLowNHighT2EdgeCase(self):
     myT = T.TCurve(3)
     self.assertAlmostEquals(myT.p(5.8409, 2), .99, 3)
Exemplo n.º 2
0
 def test600_100ShouldCalculateHighHighT2TailEdgeCase(self):
     myT = T.TCurve(20)
     self.assertAlmostEquals(myT.p(2.8453, 2), .99, 3)
Exemplo n.º 3
0
 def test100_010_ShouldConstruct(self):
     self.assertIsInstance(T.TCurve(self.nominalN), T.TCurve)
     # additional tests are for boundary value coverage
     self.assertIsInstance(T.TCurve(2), T.TCurve)
     self.assertIsInstance(T.TCurve(29), T.TCurve)
Exemplo n.º 4
0
 def test500_001TDD(self):
     myT = T.TCurve(self.nominalN)
     t = 1.0
     n = 1234  #n doesnt matter yet
     integratedVal = 0.85555275
     self.assertAlmostEquals(myT.integrate(t, n, myT.f), integratedVal, 3)
Exemplo n.º 5
0
 def test200_030_ShouldWorkOnHalfX(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.gamma(5.0 / 2.0), 1.329, 3)
Exemplo n.º 6
0
 def test400_010_ShouldCalculateFStarterCase(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.f(0, 5), 1, 4)
Exemplo n.º 7
0
 def test500_030_shouldCalculateIntegrateWhenF3(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.integrate(1.0, 5, myT.f3), 0.142857,4)
Exemplo n.º 8
0
 def test200_020_ShouldReturnLowerTerminationCondition(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.gamma(1.0 / 2.0), math.sqrt(math.pi))
Exemplo n.º 9
0
 def test500_010_shouldCalculateIntegrateWhenF1(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.integrate(1.0, 5, myT.f1), 0.5)
Exemplo n.º 10
0
 def test500_020_shouldCalculateIntegrateWhenF2(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.integrate(1.0, 5, myT.f2), 0.333333,4)
Exemplo n.º 11
0
 def test600_102ShouldCalculatePTestcase2Tail(self):
     myT = T.TCurve(9)
     self.assertAlmostEquals(myT.p(1.8331, 2), .9, 3)
Exemplo n.º 12
0
 def test600_101ShouldCalculatePTestcase1Tail(self):
     myT = T.TCurve(5)
     self.assertAlmostEquals(myT.p(1.1558, 1), .85, 3)
Exemplo n.º 13
0
 def test500_101IntegrationOnF(self):
     myT = T.TCurve(self.nominalN)
     t = 1.8946
     n = 7
     integratedVal = 1.1694779
     self.assertAlmostEquals(myT.integrate(t, n, myT.f), integratedVal, 3)
Exemplo n.º 14
0
 def test600_930ShouldRaiseExceptionInvalidTails(self):
     myT = T.TCurve(self.nominalN)
     with self.assertRaises(ValueError) as context:
         myT.p(t=self.nominalT, tails=0)
Exemplo n.º 15
0
 def test500_040_shouldCalculateIntegrateWhenF4(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.integrate(1.0, 5, myT.f4), 0.009901,4)
     
Exemplo n.º 16
0
 def test200_010_ShouldReturnUpperTerminationCondition(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.gamma(1), 1)
Exemplo n.º 17
0
 def test600_930ShouldRaiseExceptionOnNonNumericT(self):
     expectedString = "TCurve.p:"
     myT = T.TCurve(self.nominalN)
     with self.assertRaises(ValueError) as context:
         myT.p(t= "abc", tails=1)                       
     self.assertEquals(expectedString, context.exception.args[0][0:len(expectedString)]) 
Exemplo n.º 18
0
 def test200_030_ShouldWorkOnIntegerX(self):
     myT = T.TCurve(self.nominalN)
     self.assertEquals(myT.gamma(5), 24)
Exemplo n.º 19
0
 def test600_020ShouldCalculateNominalCase2Tail(self):
     myT = T.TCurve(7)
     self.assertAlmostEquals(myT.p(1.8946, 2), .90, 3)
Exemplo n.º 20
0
 def test300_010_ShouldCalculateLHP(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.calculateConstant(5), 0.37960669, 4)
Exemplo n.º 21
0
 def test600_040ShouldCalculateLowNLowT2TailEdgeCase(self):
     myT = T.TCurve(3)
     self.assertAlmostEquals(myT.p(0.2767, 2), 0.2, 3)
Exemplo n.º 22
0
 def test400_020_ShouldCalculateF(self):
     myT = T.TCurve(self.nominalN)
     self.assertAlmostEquals(myT.f(1, 5), 0.578703704)
Exemplo n.º 23
0
 def test600_060ShouldCalculateHighNLowT2TailEdgeCase(self):
     myT = T.TCurve(20)
     self.assertAlmostEquals(myT.p(0.2567, 2), 0.2, 3)
Exemplo n.º 24
0
 def test100_940_ShouldRaiseExceptionOnMissingN(self):
     expectedString = "TCurve.__init__:"
     with self.assertRaises(ValueError) as context:
         T.TCurve()
     self.assertEquals(expectedString,
                       context.exception.args[0][0:len(expectedString)])
Exemplo n.º 25
0
 def test501_003IntegrationOnF2(self):
     myT = T.TCurve(self.nominalN)
     t = 16.0
     n = 1234  #n doesnt matter for f2
     integratedVal = 1365.3333333
     self.assertAlmostEquals(myT.integrate(t, n, myT.f2), integratedVal, 3)