fix test update_query_params error

This commit is contained in:
Prodesire 2018-03-27 21:11:15 +08:00
parent 2417c381da
commit c0b02c30cd
1 changed files with 5 additions and 3 deletions

View File

@ -55,6 +55,8 @@ def test_check_connect(port=None):
def test_update_query_params():
assert update_query_params('http://example.com/', {'foo': 1}) == 'http://example.com/?foo=1'
assert update_query_params('http://example.com/?foo=1', {'foo': 2}) == 'http://example.com/?foo=2'
assert update_query_params('http://example.com/?foo=1', {'foo': 2, 'bar': 3}) == 'http://example.com/?foo=2&bar=3'
base = 'http://example.com/'
assert update_query_params(base, {'foo': 1}) == base + '?foo=1'
assert update_query_params(base + '?foo=1', {'foo': 2}) == base + '?foo=2'
assert update_query_params(base + '?foo=1', {'foo': 2, 'bar': 3}) in \
(base + '?foo=2&bar=3', base + '?foo=2&bar=3')