예제 #1
0
def test_validate_url_ok_user_port():
    assert handler.validate_url('http://[email protected]:8080') is True
예제 #2
0
def test_validate_url_nok_s3():
    assert handler.validate_url('s3://my-bucket/') is False
예제 #3
0
def test_validate_url_nok_protocol_only():
    assert handler.validate_url('http://') is False
예제 #4
0
def test_validate_url_nok_end_dot():
    assert handler.validate_url('http://www.foo.bar./') is True
예제 #5
0
def test_validate_url_nok_malformed_https():
    assert handler.validate_url('https/:/fdsa.com') is False
예제 #6
0
def test_validate_url_ok_leet():
    assert handler.validate_url('http://1337.net') is True
예제 #7
0
def test_validate_url_ok_https():
    assert handler.validate_url('https://foo_bar.example.com/') is True
예제 #8
0
def test_validate_url_ok_unicode_trailing_slash():
    assert handler.validate_url('http://⌘.ws/') is True
예제 #9
0
def test_validate_url_ok_anchor():
    assert handler.validate_url(
        'http://foo.com/blah_(wikipedia)#cite-1') is True
예제 #10
0
def test_validate_url_ok_dash_china():
    assert handler.validate_url('http://➡.ws/䨹') is True
예제 #11
0
def test_validate_url_ok_unicode():
    assert handler.validate_url('http://⌘.ws') is True
예제 #12
0
def test_validate_url_ok_ip_port():
    assert handler.validate_url('http://142.42.1.1:8080/') is True
예제 #13
0
def test_validate_url_ok_ip():
    assert handler.validate_url('http://142.42.1.1/') is True
예제 #14
0
def test_validate_url_ok_user_port_trailing_slash():
    assert handler.validate_url('http://[email protected]:8080/') is True
예제 #15
0
def test_validate_url_ok_china():
    assert handler.validate_url('http://例子.测试') is True
예제 #16
0
def test_validate_url_ok_unicode_in_parens():
    assert handler.validate_url('http://foo.com/unicode_(✪)_in_parens') is True
예제 #17
0
def test_validate_url_ok_regex_from_hell():
    assert handler.validate_url(
        'http://-.~_!$&\'()*+,;=:%40:80%2f::::::@example.com') is True
예제 #18
0
def test_validate_url_ok_something_after_parens():
    assert handler.validate_url(
        'http://foo.com/(something)?after=parens') is True
예제 #19
0
def test_validate_url_ok_dash_domain():
    assert handler.validate_url('http://a.b-c.de') is True
예제 #20
0
def test_validate_url_ok_emoji():
    assert handler.validate_url('http://☺.damowmow.com/') is True
예제 #21
0
def test_validate_url_nok_double_dash_domain():
    assert handler.validate_url('http://a.b--c.de/') is True
예제 #22
0
def test_validate_url_ok_anchor_qs():
    assert handler.validate_url(
        'http://code.google.com/events/#&product=browser') is True
예제 #23
0
def test_validate_url_nok_malformed_http():
    assert handler.validate_url('http/:/asdf.com/') is False
예제 #24
0
def test_validate_url_ok_short():
    assert handler.validate_url('http://j.mp') is True
예제 #25
0
def test_validate_url_nok_hostname_only():
    assert handler.validate_url('example') is False
예제 #26
0
def test_validate_url_ok_encoded():
    assert handler.validate_url(
        'http://foo.bar/?q=Test%20URL-encoded%20stuff') is True
예제 #27
0
def test_validate_url_nok_missingtld_https():
    assert handler.validate_url('https://missingtld') is False
예제 #28
0
def test_validate_url_ok_arabic():
    assert handler.validate_url('http://مثال.إختبار') is True
예제 #29
0
def test_validate_url_nok_double_dot():
    assert handler.validate_url('http://..') is False
예제 #30
0
def test_validate_url_ok_authentication_port_trailing_slash():
    assert handler.validate_url(
        'http://*****:*****@example.com:8080/') is True