def test_swap_bytes(self): self.assertEqual(swap_bytes("aaaabbbbcccc", 4), "ccccbbbbaaaa")
def test_swap_bytes(self): self.assertEqual(swap_bytes(six.b("aaaabbbbcccc"), 4), six.b("ccccbbbbaaaa")) self.assertEqual(swap_bytes(six.b("abcdefgh"), 2), six.b("ghefcdab")) self.assertEqual(swap_bytes(six.b("00011011"), 2), six.b("11100100"))
def test_swap_bytes(self): self.assertEqual(swap_bytes(b"aaaabbbbcccc", 4), b"ccccbbbbaaaa") self.assertEqual(swap_bytes(b"abcdefgh", 2), b"ghefcdab") self.assertEqual(swap_bytes(b"00011011", 2), b"11100100")