Public feed #727538

Mine

public python v1 · immutable
Raw Edit
·published 2007-10-06 03:14 UTC
rendered paste body
import noseimport verifydef test_verify_isbn_correct_numeric_checksum():    assert verify.verify_isbn('0-345-31452-2') == True,\           'The checksum is a numerical value and all digits are correct.'    def test_verify_isbn_correct_checksum_X():    assert verify.verify_isbn('0-688-09368-X') == True,\           'The checksum is X and all the digits are correct.'def test_verify_isbn_incorrect_numeric_checksum():    assert verify.verify_isbn('0-354-31452-2') == False,\           'The digits are out of order and the checksum is numeric.'def test_verify_isbn_incorrect_checksum_X():    assert verify.verify_isbn('0-688-09386-X') == False,\           'The digits are out of order and the checksum is X.'def test_verify_isbn_wrong_length():    assert verify.verify_isbn('0-68-09386-X') == False,\           'The isbn entered has the wrong number of characters.'    def test_verify_isbn_wrong_type():    assert verify.verify_isbn([0-345-31452-2]) == False,\           'The isbn entered is not in string format.'    def test_verify_isbn_no_dashes():    assert verify.verify_isbn('0345314522') == True,\           'The isbn entered does not contain any dashes.'    nose.runmodule()