def test_floatNumberInBrackets(self): fieldValue = "Istnieje i jest poprawna (2.4 pkt.)" returnValue = getNumberFromFieldVaule(fieldValue) self.assertEqual(returnValue, 2.4)
def test_emptyField(self): fieldValue = "" returnValue = getNumberFromFieldVaule(fieldValue) self.assertEqual(returnValue, 0)
def test_negativeFloatWithBrackets(self): fieldValue = "Optymalnie (-1.5 pkt.)" returnValue = getNumberFromFieldVaule(fieldValue) self.assertEqual(returnValue, -1.5)
def test_negativeFloatWithoutBrackets(self): fieldValue = "-1.4" returnValue = getNumberFromFieldVaule(fieldValue) self.assertEqual(returnValue, -1.4)
def test_onlyFloatWithCommaInField(self): fieldValue = "3,4" returnValue = getNumberFromFieldVaule(fieldValue) self.assertEqual(returnValue, 3.4)
def test_onlyIntegerInField(self): fieldValue = "3" returnValue = getNumberFromFieldVaule(fieldValue) self.assertEqual(returnValue, 3)
def test_noNumberInField(self): fieldValue = "Analiza poprawna :)" returnValue = getNumberFromFieldVaule(fieldValue) self.assertEqual(returnValue, 0)