From 23131f21bb2e1837665d30cba857477dd1bbcdfd Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 2 Nov 2014 13:21:57 +1100 Subject: [PATCH] * Add tests for like_url --- tests/test_urlish.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/test_urlish.py diff --git a/tests/test_urlish.py b/tests/test_urlish.py new file mode 100644 index 000000000..859473706 --- /dev/null +++ b/tests/test_urlish.py @@ -0,0 +1,20 @@ +from spacy.orth import is_urlish + +def test_basic_url(): + assert is_urlish('www.google.com') + assert is_urlish('google.com') + assert is_urlish('sydney.com') + assert is_urlish('Sydney.edu') + assert is_urlish('2girls1cup.org') + + +def test_close_enough(): + assert is_urlish('http://stupid') + assert is_urlish('www.hi') + + +def test_non_match(): + assert not is_urlish('dog') + assert not is_urlish('1.2') + assert not is_urlish('1.a') + assert not is_urlish('hello.There')