File tree 1 file changed +11
-3
lines changed 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 3
3
from phone_number import Phone
4
4
5
5
6
- # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2 .0
6
+ # Tests adapted from `problem-specifications//canonical-data.json` @ v1.4 .0
7
7
8
8
class PhoneTest (unittest .TestCase ):
9
9
def test_cleans_number (self ):
@@ -46,14 +46,22 @@ def test_invalid_with_punctuation(self):
46
46
with self .assertRaisesWithMessage (ValueError ):
47
47
Phone ("123-@:!-7890" )
48
48
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 ):
50
54
with self .assertRaisesWithMessage (ValueError ):
51
55
Phone ("(123) 456-7890" )
52
56
53
- def test_invalid_when_exchange_code_does_start_with_1 (self ):
57
+ def test_invalid_if_exchange_code_starts_with_0 (self ):
54
58
with self .assertRaisesWithMessage (ValueError ):
55
59
Phone ("(223) 056-7890" )
56
60
61
+ def test_invalid_if_exchange_code_starts_with_1 (self ):
62
+ with self .assertRaisesWithMessage (ValueError ):
63
+ Phone ("(223) 156-7890" )
64
+
57
65
# Track specific tests
58
66
def test_area_code (self ):
59
67
number = Phone ("2234567890" )
You can’t perform that action at this time.
0 commit comments