def test_checksum_calculation_referenceimpl_random(): """Test that the checksum calculation works, following reference impl.""" base = ''.join(random.choices(string.ascii_letters + string.digits, k=8)).upper() ext = ''.join(random.choices(string.ascii_letters + string.digits, k=3)).upper() sfn = EightDotThree() sfn.set_str_name(f"{base}.{ext}") assert sfn.checksum() == calculate_checksum_referenceimpl(sfn.name)
def test_checksum_calculation_referenceimpl(): """Test that the checksum calculation works, following reference impl.""" sfn = EightDotThree() sfn.set_str_name("FILENAME.TXT") assert sfn.checksum() == calculate_checksum_referenceimpl(sfn.name)
def test_checksum_calculation_precalculated(): """Test that the checksum calculation works, with a precalculated value.""" sfn = EightDotThree() sfn.set_str_name("FILENAME.TXT") assert sfn.checksum() == 58