def test_urljoin(self): for base, args, expected in [ ("http://localhost", ["path1"], "http://localhost/path1"), ("http://localhost/path1", ["path2"], "http://localhost/path1/path2"), ("http://localhost", ["path1", "path2"], "http://localhost/path1/path2"), ("http://localhost?foo=bar", ["path1"], "http://localhost/path1?foo=bar"), ]: assert urljoin(base, *args) == expected
def test_urljoin(): data = [ ('http://localhost', ['path1'], 'http://localhost/path1'), ('http://localhost/path1', ['path2'], 'http://localhost/path1/path2'), ('http://localhost', ['path1', 'path2'], 'http://localhost/path1/path2'), ('http://localhost?foo=bar', ['path1'], 'http://localhost/path1?foo=bar'), ] for base, args, expected in data: assert urljoin(base, *args) == expected
def test_urljoin(self): for base, args, expected in [ ('http://localhost', ['path1'], 'http://localhost/path1'), ('http://localhost/path1', ['path2'], 'http://localhost/path1/path2'), ('http://localhost', ['path1', 'path2'], 'http://localhost/path1/path2'), ('http://localhost?foo=bar', ['path1'], 'http://localhost/path1?foo=bar'), ]: eq_(urljoin(base, *args), expected)