diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/library/ip.test.py | 3 | ||||
| -rw-r--r-- | tests/library/phone.test.py | 3 | ||||
| -rw-r--r-- | tests/library/postal.test.py | 2 | ||||
| -rw-r--r-- | tests/library/url.test.py | 3 |
4 files changed, 11 insertions, 0 deletions
diff --git a/tests/library/ip.test.py b/tests/library/ip.test.py index b288004..2028024 100644 --- a/tests/library/ip.test.py +++ b/tests/library/ip.test.py @@ -1,10 +1,13 @@ from edify.library import ip + def test_valid_ipv4(): assert ip("192.168.1.1") + def test_valid_ipv6(): assert ip("2001:db8::1") + def test_bad_ip(): assert not ip("999.999.999.999") diff --git a/tests/library/phone.test.py b/tests/library/phone.test.py index 53167c0..0076065 100644 --- a/tests/library/phone.test.py +++ b/tests/library/phone.test.py @@ -1,10 +1,13 @@ from edify.library import phone + def test_valid_phone(): assert phone("+1-555-1234") + def test_short_phone(): assert phone("911") + def test_bad_phone(): assert not phone("!!!") diff --git a/tests/library/postal.test.py b/tests/library/postal.test.py index 5527ac6..f4b3dc3 100644 --- a/tests/library/postal.test.py +++ b/tests/library/postal.test.py @@ -1,7 +1,9 @@ from edify.library import postal + def test_valid_postal(): assert postal("12345") + def test_bad_postal(): assert not postal("nope-!!!") diff --git a/tests/library/url.test.py b/tests/library/url.test.py index 50bad29..d4b2eeb 100644 --- a/tests/library/url.test.py +++ b/tests/library/url.test.py @@ -1,10 +1,13 @@ from edify.library import url + def test_valid_http_url(): assert url("http://example.com") + def test_valid_https_url(): assert url("https://example.com/path") + def test_bad_url(): assert not url("nope !!!") |
