Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions exercises/practice/isbn-verifier/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ description = "invalid character in isbn is not treated as zero"
[28025280-2c39-4092-9719-f3234b89c627]
description = "X is only valid as a check digit"

[8005b57f-f194-44ee-88d2-a77ac4142591]
description = "only one check digit is allowed"

[fdb14c99-4cf8-43c5-b06d-eb1638eff343]
description = "X is not substituted by the value 10"

[f6294e61-7e79-46b3-977b-f48789a4945b]
description = "valid isbn without separating dashes"

Expand Down
8 changes: 7 additions & 1 deletion exercises/practice/isbn-verifier/isbn_verifier_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/isbn-verifier/canonical-data.json
# File last updated on 2023-07-19
# File last updated on 2025-12-30

import unittest

Expand Down Expand Up @@ -31,6 +31,12 @@ def test_invalid_character_in_isbn_is_not_treated_as_zero(self):
def test_x_is_only_valid_as_a_check_digit(self):
self.assertIs(is_valid("3-598-2X507-9"), False)

def test_only_one_check_digit_is_allowed(self):
self.assertIs(is_valid("3-598-21508-96"), False)

def test_x_is_not_substituted_by_the_value_10(self):
self.assertIs(is_valid("3-598-2X507-5"), False)

def test_valid_isbn_without_separating_dashes(self):
self.assertIs(is_valid("3598215088"), True)

Expand Down
Loading