Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_good_tle_checksum():
for line in LINE1, LINE2:
checksum = int(line[-1])
assertEqual(io.compute_checksum(line), checksum)
assertEqual(io.fix_checksum(line[:68]), line)
io.verify_checksum(line)
def test_bad_tle_checksum():
checksum = LINE1[-1]
assertEqual(checksum, '3')
bad = LINE1[:68] + '7'
assertRaises(ValueError, io.verify_checksum, bad)
assertEqual(io.fix_checksum(bad), LINE1)