63 |
63 |
def test_url_server():
|
64 |
64 |
assert get_variadic_url('[url]/foobar',
|
65 |
65 |
{'url': 'http://www.example.net'}) == 'http://www.example.net/foobar'
|
|
66 |
assert get_variadic_url('[url]/foobar',
|
|
67 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar'
|
|
68 |
assert get_variadic_url('[url]foobar',
|
|
69 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar'
|
66 |
70 |
|
67 |
|
def test_url_server_qs_without_slash():
|
|
71 |
def test_url_server_qs():
|
|
72 |
assert get_variadic_url('[url]?foo=bar',
|
|
73 |
{'url': 'http://www.example.net'}) == 'http://www.example.net/?foo=bar'
|
68 |
74 |
assert get_variadic_url('[url]?foo=bar',
|
69 |
75 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/?foo=bar'
|
|
76 |
assert get_variadic_url('[url]/?foo=bar',
|
|
77 |
{'url': 'http://www.example.net'}) == 'http://www.example.net/?foo=bar'
|
|
78 |
assert get_variadic_url('[url]/?foo=bar',
|
|
79 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/?foo=bar'
|
70 |
80 |
|
71 |
81 |
def test_url_server_more():
|
72 |
82 |
assert get_variadic_url('[url]/foobar/json?toto',
|
73 |
83 |
{'url': 'http://www.example.net'}) == 'http://www.example.net/foobar/json?toto'
|
|
84 |
assert get_variadic_url('[url]/foobar/json?toto',
|
|
85 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar/json?toto'
|
|
86 |
assert get_variadic_url('[url]foobar/json?toto',
|
|
87 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar/json?toto'
|
74 |
88 |
|
75 |
89 |
def test_url_server_even_more():
|
76 |
90 |
assert get_variadic_url('[url]/foobar/json?foo=bar',
|
77 |
91 |
{'url': 'http://www.example.net'}) == 'http://www.example.net/foobar/json?foo=bar'
|
|
92 |
assert get_variadic_url('[url]/foobar/json?foo=bar',
|
|
93 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar/json?foo=bar'
|
|
94 |
assert get_variadic_url('[url]foobar/json?foo=bar',
|
|
95 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar/json?foo=bar'
|
78 |
96 |
|
79 |
97 |
def test_url_server_even_more_more():
|
80 |
98 |
assert get_variadic_url('[url]/foobar/baz/json?foo=bar',
|
81 |
99 |
{'url': 'http://www.example.net'}) == 'http://www.example.net/foobar/baz/json?foo=bar'
|
|
100 |
assert get_variadic_url('[url]/foobar/baz/json?foo=bar',
|
|
101 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar/baz/json?foo=bar'
|
|
102 |
assert get_variadic_url('[url]foobar/baz/json?foo=bar',
|
|
103 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar/baz/json?foo=bar'
|
82 |
104 |
|
83 |
105 |
def test_url_whole_with_qs():
|
84 |
106 |
assert get_variadic_url('[url]',
|
... | ... | |
96 |
118 |
def test_url_base_and_missing_var():
|
97 |
119 |
assert get_variadic_url('[url]/foobar/[path]',
|
98 |
120 |
{'url': 'http://www.example.net'}) == 'http://www.example.net/foobar/[path]'
|
|
121 |
assert get_variadic_url('[url]foobar/[path]',
|
|
122 |
{'url': 'http://www.example.net/'}) == 'http://www.example.net/foobar/[path]'
|