fix roundtripping tests

This commit is contained in:
Mahmoud Hashemi 2023-02-19 22:06:33 -08:00
parent e59798c93b
commit 073c756d1a
1 changed files with 7 additions and 2 deletions

View File

@ -95,9 +95,14 @@ def test_bits():
chk(Bits('11') >> 1, Bits('1'))
chk(Bits('1') << 1, Bits('10'))
assert Bits('0') != Bits('00')
chk(
Bits.from_bytes(Bits.from_hex(Bits('10101010').as_bytes()).as_hex()),
# test roundtrip as_/from_hex
chk(Bits.from_hex(Bits('10101010').as_hex()),
Bits('10101010'))
# test roundtrip as_/from_bytes
chk(
Bits.from_bytes(Bits('10101010').as_bytes()),
Bits('10101010'))
# pile of roundtripping
chk(Bits.from_int(
Bits.from_bin(
Bits.from_list(