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