Skip to content

Commit 8625d3b

Browse files
mrcfpscmccandless
authored andcommitted
phone-number: update tests to v1.4.0 (#1312)
1 parent 6c8a35a commit 8625d3b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

exercises/phone-number/phone_number_test.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from phone_number import Phone
44

55

6-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
6+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0
77

88
class PhoneTest(unittest.TestCase):
99
def test_cleans_number(self):
@@ -46,14 +46,22 @@ def test_invalid_with_punctuation(self):
4646
with self.assertRaisesWithMessage(ValueError):
4747
Phone("123-@:!-7890")
4848

49-
def test_invalid_when_area_code_does_start_with_1(self):
49+
def test_invalid_if_area_code_starts_with_0(self):
50+
with self.assertRaisesWithMessage(ValueError):
51+
Phone("(023) 456-7890")
52+
53+
def test_invalid_if_area_code_starts_with_1(self):
5054
with self.assertRaisesWithMessage(ValueError):
5155
Phone("(123) 456-7890")
5256

53-
def test_invalid_when_exchange_code_does_start_with_1(self):
57+
def test_invalid_if_exchange_code_starts_with_0(self):
5458
with self.assertRaisesWithMessage(ValueError):
5559
Phone("(223) 056-7890")
5660

61+
def test_invalid_if_exchange_code_starts_with_1(self):
62+
with self.assertRaisesWithMessage(ValueError):
63+
Phone("(223) 156-7890")
64+
5765
# Track specific tests
5866
def test_area_code(self):
5967
number = Phone("2234567890")

0 commit comments

Comments
 (0)