Skip to content

isbn-verifier: updates tests to v2.7.0 #1462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions exercises/isbn-verifier/isbn_verifier_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from isbn_verifier import verify


# Tests adapted from `problem-specifications//canonical-data.json` @ v2.4.0
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.7.0

class IsbnVerifierTest(unittest.TestCase):

Expand Down Expand Up @@ -37,12 +37,12 @@ def test_invalid_isbn_without_check_digit_and_dashes(self):
def test_invalid_too_long_isbn_with_no_dashes(self):
self.assertIs(verify('3598215078X'), False)

def test_invalid_too_short_isbn(self):
self.assertIs(verify('00'), False)

def test_invalid_isbn_without_check_digit(self):
self.assertIs(verify('3-598-21507'), False)

def test_invalid_too_long_isbn(self):
self.assertIs(verify('3-598-21507-XX'), False)

def test_invalid_check_digit_X_used_for_0(self):
self.assertIs(verify('3-598-21515-X'), False)

Expand All @@ -52,6 +52,12 @@ def test_valid_empty_isbn(self):
def test_input_is_nine_characters(self):
self.assertIs(verify('134456729'), False)

def test_invalid_characters_are_not_ignored(self):
self.assertIs(verify('3132P34035'), False)

def test_input_is_too_long_but_contains_a_valid_isbn(self):
self.assertIs(verify('98245726788'), False)


if __name__ == '__main__':
unittest.main()