示例#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