Exemplo n.º 1
0
 def test100_970ShouldRaiseExceptionOnNonIntegerN(self):
     self.setN(2.5)
     self.setT(self.nominalT)
     self.setTails(1)
     result = prob(self.inputDictionary)
     self.assertIn(self.errorKey, result)
     self.assertIn(self.errorValue, result[self.errorKey])
Exemplo n.º 2
0
 def test100_010ShouldCalculateNominalCase1TailHttp(self):
     self.setT(1.8946)
     self.setN(7)
     self.setTails(1)
     self.setExtra("a")
     result = prob(self.inputDictionary)
     self.assertAlmostEqual(result[self.solutionKey], 0.950, 3)
Exemplo n.º 3
0
 def test100_930ShouldRaiseExceptionOnNonNumericT(self):
     self.setT("abc")
     self.setN(self.nominalN)
     self.setTails(self.nominalTails)
     result = prob(self.inputDictionary)
     self.assertIn(self.errorKey, result)
     self.assertIn(self.errorValue, result[self.errorKey])
Exemplo n.º 4
0
 def test100_960ShouldRaiseExceptionOnOutOfBoundN(self):
     self.setN(0)
     self.setT(self.nominalT)
     self.setTails(1)
     result = prob(self.inputDictionary)
     self.assertIn(self.errorKey, result)
     self.assertIn(self.errorValue, result[self.errorKey])
Exemplo n.º 5
0
 def test100_940ShouldRaiseExceptionOnInvalidTails(self):
     self.setTails(0)
     self.setT(self.nominalT)
     self.setN(self.nominalN)
     result = prob(self.inputDictionary)
     self.assertIn(self.errorKey, result)
     self.assertIn(self.errorValue, result[self.errorKey])
def dispatch():
    try:
        parm = {}
        for key in request.args:
            parm[key] = str(request.args.get(key, ''))
        result = prob.prob(parm)
        return str(result)
    except:
        return str("internal error")
Exemplo n.º 7
0
 def test100_030ShouldCalculateLowNLowT1TailEdgeCase(self):
     self.setT(0.2767)
     self.setN(3)
     self.setTails(1)
     result = prob(self.inputDictionary)
     self.assertAlmostEqual(result[self.solutionKey], 0.600, 3)
Exemplo n.º 8
0
 def test100_020ShouldCalculateNominalCase2Tail(self):
     self.setT(1.8946)
     self.setN(7)
     self.setTails(2)
     result = prob(self.inputDictionary)
     self.assertAlmostEqual(result[self.solutionKey], 0.900, 3)
Exemplo n.º 9
0
 def test100_950ShouldRaiseExceptionOnMissingN(self):
     self.setT(self.nominalT)
     self.setTails(1)
     result = prob(self.inputDictionary)
     self.assertIn(self.errorKey, result)
     self.assertIn(self.errorValue, result[self.errorKey])
Exemplo n.º 10
0
 def test100_110ShouldCalculateWithDefaultTails(self):
     self.setT(1.8946)
     self.setN(7)
     result = prob(self.inputDictionary)
     self.assertAlmostEqual(result[self.solutionKey], 0.900, 3)
Exemplo n.º 11
0
 def test100_100ShouldCalculateHighHighT2TailEdgeCase(self):
     self.setT(2.8453)
     self.setN(20)
     self.setTails(2)
     result = prob(self.inputDictionary)
     self.assertAlmostEqual(result[self.solutionKey], 0.990, 3)
Exemplo n.º 12
0
 def test100_080ShouldCalculateLowNHighT2EdgeCase(self):
     self.setT(5.8409)
     self.setN(3)
     self.setTails(2)
     result = prob(self.inputDictionary)
     self.assertAlmostEqual(result[self.solutionKey], 0.990, 3)
Exemplo n.º 13
0
 def test100_060ShouldCalculateHighNLowT2TailEdgeCase(self):
     self.setT(0.2567)
     self.setN(20)
     self.setTails(2)
     result = prob(self.inputDictionary)
     self.assertAlmostEqual(result[self.solutionKey], 0.200, 3)