Exemple #1
0
 def testValueOfOneReturnsOne(self):
     value = ultrak498.bcd_to_int(chr(0x10))
     self.assertEqual(value, 1)
Exemple #2
0
 def testMultiByteStringRaisesException(self):
     with self.assertRaises(ValueError):
         ultrak498.bcd_to_int("ab")
Exemple #3
0
 def testValueOfOneReturnsOne(self):
     value = ultrak498.bcd_to_int(chr(0x10))
     self.assertEqual(value, 1)
Exemple #4
0
 def testValueOf50Returns50(self):
     value = ultrak498.bcd_to_int(chr(0x05))
     self.assertEqual(value, 50)
Exemple #5
0
 def testValueOf98Returns98(self):
     value = ultrak498.bcd_to_int(chr(0x89))
     self.assertEqual(value, 98)
Exemple #6
0
 def testValueOfElevenReturnsEleven(self):
     value = ultrak498.bcd_to_int(chr(0x11))
     self.assertEqual(value, 11)
Exemple #7
0
 def testValueOfTwentyReturnsTwenty(self):
     value = ultrak498.bcd_to_int(chr(0x02))
     self.assertEqual(value, 20)
Exemple #8
0
 def testValueOf42Returns42(self):
     value = ultrak498.bcd_to_int(chr(0x24))
     self.assertEqual(value, 42)
Exemple #9
0
 def testValueOf50Returns50(self):
     value = ultrak498.bcd_to_int(chr(0x05))
     self.assertEqual(value, 50)
Exemple #10
0
 def testValueOfFifteenReturnsFifteen(self):
     value = ultrak498.bcd_to_int(chr(0x51))
     self.assertEqual(value, 15)
Exemple #11
0
 def testValueOfTwentyReturnsTwenty(self):
     value = ultrak498.bcd_to_int(chr(0x02))
     self.assertEqual(value, 20)
Exemple #12
0
 def testValueOfElevenReturnsEleven(self):
     value = ultrak498.bcd_to_int(chr(0x11))
     self.assertEqual(value, 11)
Exemple #13
0
 def testValueOfTenReturnsTen(self):
     value = ultrak498.bcd_to_int(chr(0x01))
     self.assertEqual(value, 10)
Exemple #14
0
 def testValueOfNineReturnsNine(self):
     value = ultrak498.bcd_to_int(chr(0x90))
     self.assertEqual(value, 9)
Exemple #15
0
 def testValueOfNineReturnsNine(self):
     value = ultrak498.bcd_to_int(chr(0x90))
     self.assertEqual(value, 9)
Exemple #16
0
 def testValueOf75Returns75(self):
     value = ultrak498.bcd_to_int(chr(0x57))
     self.assertEqual(value, 75)
Exemple #17
0
 def testValueOfTenReturnsTen(self):
     value = ultrak498.bcd_to_int(chr(0x01))
     self.assertEqual(value, 10)
Exemple #18
0
 def testValueOf98Returns98(self):
     value = ultrak498.bcd_to_int(chr(0x89))
     self.assertEqual(value, 98)
Exemple #19
0
 def testValueOfFifteenReturnsFifteen(self):
     value = ultrak498.bcd_to_int(chr(0x51))
     self.assertEqual(value, 15)
Exemple #20
0
 def testValueOf99Returns99(self):
     value = ultrak498.bcd_to_int(chr(0x99))
     self.assertEqual(value, 99)
Exemple #21
0
 def testValueOf42Returns42(self):
     value = ultrak498.bcd_to_int(chr(0x24))
     self.assertEqual(value, 42)
Exemple #22
0
 def testMultiByteStringRaisesException(self):
     with self.assertRaises(ValueError):
         ultrak498.bcd_to_int("ab")
Exemple #23
0
 def testValueOf75Returns75(self):
     value = ultrak498.bcd_to_int(chr(0x57))
     self.assertEqual(value, 75)
Exemple #24
0
 def testTensPlaceGreaterThanNineRaisesException(self):
     with self.assertRaises(ValueError):
         ultrak498.bcd_to_int(chr(0x0A))
Exemple #25
0
 def testValueOf99Returns99(self):
     value = ultrak498.bcd_to_int(chr(0x99))
     self.assertEqual(value, 99)
Exemple #26
0
 def testValueOfZeroReturnsZero(self):
     value = ultrak498.bcd_to_int(chr(0x00))
     self.assertEqual(value, 0)
Exemple #27
0
 def testTensPlaceGreaterThanNineRaisesException(self):
     with self.assertRaises(ValueError):
         ultrak498.bcd_to_int(chr(0x0A))
Exemple #28
0
 def testValueOfZeroReturnsZero(self):
     value = ultrak498.bcd_to_int(chr(0x00))
     self.assertEqual(value, 0)