示例#1
0
文件: test_url.py 项目: ppecheux/yarl
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"
示例#2
0
文件: test_url.py 项目: ppecheux/yarl
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"
示例#3
0
文件: test_url.py 项目: xppt/yarl
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")
示例#4
0
文件: test_url.py 项目: xppt/yarl
def test_with_name_for_relative_path2():
    url = URL("a/b")
    url2 = url.with_name("c")
    assert url2.raw_parts == ("a", "c")
示例#5
0
文件: test_url.py 项目: xppt/yarl
def test_with_name_for_naked_path():
    url = URL("http://example.com")
    url2 = url.with_name("a")
    assert url2.raw_parts == ("/", "a")
示例#6
0
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')
示例#7
0
def test_with_name_for_relative_path2():
    url = URL('a/b')
    url2 = url.with_name('c')
    assert url2.raw_parts == ('a', 'c')
示例#8
0
def test_with_name_for_naked_path():
    url = URL('http://example.com')
    url2 = url.with_name('a')
    assert url2.raw_parts == ('/', 'a')
示例#9
0
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')
示例#10
0
文件: test_url.py 项目: asvetlov/yarl
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")
示例#11
0
文件: test_url.py 项目: asvetlov/yarl
def test_with_name_for_relative_path2():
    url = URL("a/b")
    url2 = url.with_name("c")
    assert url2.raw_parts == ("a", "c")
示例#12
0
文件: test_url.py 项目: asvetlov/yarl
def test_with_name_for_naked_path():
    url = URL("http://example.com")
    url2 = url.with_name("a")
    assert url2.raw_parts == ("/", "a")
示例#13
0
文件: test_url.py 项目: asvetlov/yarl
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")