def test_unhexlify_not_python(): """ Test that the MicroPython script start format is present. """ assert "" == uflash.unhexlify( ":020000040003F7\n:10E000000000000000000000000000000000000010" )
def test_unhexlify_bad_unicode(): """ Test that invalid Unicode is dealt gracefully returning an empty string. """ assert "" == uflash.unhexlify( ":020000040003F7\n:10E000004D50FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" )
def test_unhexlify(): """ Ensure that we can get the script back out using unhexlify and that the result is a properly decoded string. """ unhexlified = uflash.unhexlify(TEST_SCRIPT_HEXLIFIED) assert unhexlified == TEST_SCRIPT.decode("utf-8")
def test_unhexlify(): """ Ensure that we can get the script back out using unhexlify and that the result is a properly decoded string. """ hexlified = uflash.hexlify(TEST_SCRIPT) unhexlified = uflash.unhexlify(hexlified) assert unhexlified == TEST_SCRIPT.decode('utf-8')