def test_with_name_percent_encoded(): url = URL("http://example.com/path") url2 = url.with_name("%cf%80") assert url2.raw_parts == ("/", "%25cf%2580") assert url2.parts == ("/", "%cf%80") assert url2.raw_path == "/%25cf%2580" assert url2.path == "/%cf%80"
def test_with_name(): url = URL("http://example.com/a/b") assert url.raw_parts == ("/", "a", "b") url2 = url.with_name("c") assert url2.raw_parts == ("/", "a", "c") assert url2.parts == ("/", "a", "c") assert url2.raw_path == "/a/c" assert url2.path == "/a/c"
def test_with_name_for_relative_path_starting_from_slash2(): url = URL("/a/b") url2 = url.with_name("c") assert url2.raw_parts == ("/", "a", "c")
def test_with_name_for_relative_path2(): url = URL("a/b") url2 = url.with_name("c") assert url2.raw_parts == ("a", "c")
def test_with_name_for_naked_path(): url = URL("http://example.com") url2 = url.with_name("a") assert url2.raw_parts == ("/", "a")
def test_with_name_for_relative_path_starting_from_slash2(): url = URL('/a/b') url2 = url.with_name('c') assert url2.raw_parts == ('/', 'a', 'c')
def test_with_name_for_relative_path2(): url = URL('a/b') url2 = url.with_name('c') assert url2.raw_parts == ('a', 'c')
def test_with_name_for_naked_path(): url = URL('http://example.com') url2 = url.with_name('a') assert url2.raw_parts == ('/', 'a')
def test_with_name(): url = URL('http://example.com/a/b') assert url.raw_parts == ('/', 'a', 'b') url2 = url.with_name('c') assert url2.raw_parts == ('/', 'a', 'c')
def test_with_name(): url = URL("http://example.com/a/b") assert url.raw_parts == ("/", "a", "b") url2 = url.with_name("c") assert url2.raw_parts == ("/", "a", "c")