def test_urljoin():
 base = 'https://www.evernote.com/'
 assert (urljoin(base) == base)
 assert (urljoin(base, '/foo/bar', 'baz/blah') == (base + 'foo/bar/baz/blah'))
 assert (urljoin(base, '/foo/', '/bar/', '/baz/') == (base + 'foo/bar/baz/'))
 assert (urljoin(base, '/foo//', '//bar/') == (base + 'foo/bar/'))
 assert (urljoin(base, '/foo//', '//bar/?q=a') == (base + 'foo/bar/?q=a'))
 assert (urljoin(base, 'foo//', '//bar/?q=a') == (base + 'foo/bar/?q=a'))
 assert (urljoin(base, 'foo//////') == (base + 'foo/'))
 assert (urljoin(base, 'foo', 'bar/baz', 'blah') == (base + 'foo/bar/baz/blah'))
 assert (urljoin(base, 'foo/', 'bar', 'baz/') == (base + 'foo/bar/baz/'))
 assert (urljoin('', '', '/////foo') == '/foo')

def test_urljoin ( ) : base = 'https://www.evernote.com/' assert ( urljoin ( base ) == base ) assert ( urljoin ( base , '/foo/bar' , 'baz/blah' ) == ( base + 'foo/bar/baz/blah' ) ) assert ( urljoin ( base , '/foo/' , '/bar/' , '/baz/' ) == ( base + 'foo/bar/baz/' ) ) assert ( urljoin ( base , '/foo//' , '//bar/' ) == ( base + 'foo/bar/' ) ) assert ( urljoin ( base , '/foo//' , '//bar/?q=a' ) == ( base + 'foo/bar/?q=a' ) ) assert ( urljoin ( base , 'foo//' , '//bar/?q=a' ) == ( base + 'foo/bar/?q=a' ) ) assert ( urljoin ( base , 'foo//////' ) == ( base + 'foo/' ) ) assert ( urljoin ( base , 'foo' , 'bar/baz' , 'blah' ) == ( base + 'foo/bar/baz/blah' ) ) assert ( urljoin ( base , 'foo/' , 'bar' , 'baz/' ) == ( base + 'foo/bar/baz/' ) ) assert ( urljoin ( '' , '' , '/////foo' ) == '/foo' )
tests url parts are properly joined with a base .