def test_checksum_class_eq(checksum_class): assert checksum_class == Checksum.checksum(CHECKSUM_CLASS_VALUE)
def test_expected_type(obj_type, value): assert type(value) == Checksum.checksum(value).type == obj_type
def test_expected_checksum(value, expected_checksum): checksum_bytes = Checksum.checksum(value).hex() assert checksum_bytes == expected_checksum, "Got '{}'\nExpected '{}' for the checksum of '{}'".format( checksum_bytes, expected_checksum, value)
def test_expected_custom_type(): _ = Checksum.checksum(Custom()).type