Example #1
0
 def test__get_new_hex__input_hex_ok19_returns_response(self):
     result = hexcalc.get_new_hex(
         ":106A6000040510060708091369281408D327140819")
     self.assertEqual("Checksum correct", result)
Example #2
0
def get_chsum(input_hex):
    return hexcalc.get_new_hex(input_hex)
Example #3
0
 def test__get_new_hex__input_hex_incorrect_checksum__returns_new_hex(self):
     result = hexcalc.get_new_hex(
         ":1068F000CC3B8DAF96680A2136CB1A4CE47E94E212")
     self.assertEqual(":1068F000CC3B8DAF96680A2136CB1A4CE47E94E2ED", result)
Example #4
0
 def test__get_new_hex__input_hex_bad__returns_response(self):
     result = hexcalc.get_new_hex("LUL")
     self.assertEqual("Bad input", result)
Example #5
0
 def test__get_new_hex__input_hex_too_short4bytes_returns_response(self):
     result = hexcalc.get_new_hex(":047FFC00FFFFFFF")
     self.assertEqual("Too short", result)
Example #6
0
 def test__get_new_hex__input_hex_shorter__returns_response(self):
     result = hexcalc.get_new_hex(":1068F000CC3B8DAF96680A2136CB1A4CEED")
     self.assertEqual("Too short", result)
Example #7
0
 def test__get_new_hex__input_hex_longer__returns_response(self):
     result = hexcalc.get_new_hex(
         ":1068F000CC3B8DAF96680A2136CB1A4CE47E94E2123ED")
     self.assertEqual("Too long", result)
Example #8
0
 def test__get_new_hex__input_hex_too_long4bytes_returns_response(self):
     result = hexcalc.get_new_hex(":047FFC00FFFFFFFF185")
     self.assertEqual("Too long", result)
Example #9
0
 def test__get_new_hex__input_hex_ok4bytes_returns_response(self):
     result = hexcalc.get_new_hex(":047FFC00FFFFFFFF85")
     self.assertEqual("Checksum correct", result)
Example #10
0
 def test__get_new_hex__input_hex_okED__returns_response(self):
     result = hexcalc.get_new_hex(
         ":1068F000CC3B8DAF96680A2136CB1A4CE47E94E2ED")
     self.assertEqual("Checksum correct", result)
Example #11
0
 def test__get_new_hex__input_hex_okB7_returns_response(self):
     result = hexcalc.get_new_hex(
         ":1068600048710620E062206AC06ABDE870400047B7")
     self.assertEqual("Checksum correct", result)