Ejemplo n.º 1
0
def test_query():
    url = http('site.com')
    assert url.query(foo='bar', bar='foo') == 'http://site.com?foo=bar&bar=foo' or 'http://site.com?bar=foo&foo=bar'
    assert url.query(foo='foo') == 'http://site.com?foo=foo&bar=foo' or 'http://site.com?bar=foo&foo=foo'
Ejemplo n.º 2
0
def test_init():
    assert http('site.com') == 'http://site.com'
    assert https('site.com') == 'https://site.com'
Ejemplo n.º 3
0
def test_path():
    url = http('site.com')
    assert url.path('foo', 'bar') == 'http://site.com/foo/bar'
    assert url.path('foo') == 'http://site.com/foo'