Skip to content

Commit

Permalink
isbn-verifier: update tests to v2.4.0 (#1373)
Browse files Browse the repository at this point in the history
* Replace test case - "invalid character in isbn"
* Add test case with only 9 digits
  • Loading branch information
mrcfps authored and cmccandless committed Apr 10, 2018
1 parent ce085c8 commit f44817c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 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.2.0
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.4.0

class IsbnVerifierTests(unittest.TestCase):

Expand All @@ -20,7 +20,7 @@ def test_invalid_check_digit_other_than_X(self):
self.assertIs(verify('3-598-21507-A'), False)

def test_invalid_character_in_isbn(self):
self.assertIs(verify('3-598-2K507-0'), False)
self.assertIs(verify('3-598-P1581-X'), False)

def test_invalid_X_other_than_check_digit(self):
self.assertIs(verify('3-598-2X507-9'), False)
Expand Down Expand Up @@ -49,6 +49,9 @@ def test_invalid_check_digit_X_used_for_0(self):
def test_valid_empty_isbn(self):
self.assertIs(verify(''), False)

def test_input_is_nine_characters(self):
self.assertIs(verify('134456729'), False)


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

0 comments on commit f44817c

Please sign in to comment.