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