Ejemplo n.º 1
0
 def testEdgeCaseNotFound2(self):
     # testing edge case with no answer
     result = searchContinuityAboveValueTwoSignals(data1, data2, 0, 4, 7,
                                                   -2, 5)
     self.assertEqual(result, errd.ERROR_NOT_FOUND)
Ejemplo n.º 2
0
 def testEdgeCaseOutOfBounds(self):
     # testing failure edge case
     result8 = searchContinuityAboveValueTwoSignals(data1, data2, 5, 99, 99,
                                                    99, 10)
     self.assertEqual(result8, errd.ERROR_OUT_OF_BOUNDS)
Ejemplo n.º 3
0
 def testEdgeCaseAnswer(self):
     # testing edge case with an answer
     result = searchContinuityAboveValueTwoSignals(data1, data2, 0, 4, -1,
                                                   -2, 5)
     self.assertEqual(result, 0)
Ejemplo n.º 4
0
 def testNotFindingAnswerUsual1(self):
     # testing case of not finding answer
     result = searchContinuityAboveValueTwoSignals(data1, data2, 10, 50, 5,
                                                   60, 5)
     self.assertEqual(result, errd.ERROR_NOT_FOUND)
Ejemplo n.º 5
0
 def testNoData2(self):
     # testing another failure case
     result = searchContinuityAboveValueTwoSignals(data1, None, 10, 50, 40,
                                                   11, 5)
     self.assertEqual(result, errd.ERROR_NO_DATA)
Ejemplo n.º 6
0
 def testTooSmall(self):
     # testing a failure case
     result = searchContinuityAboveValueTwoSignals(data1, data2, 2, 5, -2,
                                                   -2, 10)
     self.assertEqual(result, errd.ERROR_TOO_SMALL)
Ejemplo n.º 7
0
 def testBasicOp1(self):
     # testing basic operation
     result = searchContinuityAboveValueTwoSignals(data1, data2, 10, 50, 40,
                                                   11, 5)
     self.assertEqual(result, 40)