Example #1
0
def test_removeQuery_is_same_as_removeSearch():
  uri = URI('http://example.com/foo?bar=baz')
  assert uri.removeQuery(['bar']).toString() == uri.removeSearch(['bar']).toString()
Example #2
0
def test_removing_multiple_search_keys_and_values_from_uri_given_keys():
  uri = URI('http://example.com/foo?bar=baz&sam=sue')
  assert uri.removeSearch(['bar', 'sam']).toString() == 'http://example.com/foo'
Example #3
0
def test_removing_only_keys_with_given_value_from_uri():
  uri = URI("http://example.com/foo?bar=baz&name=sue")
  assert uri.removeSearch(['bar'], 'baz').toString() == "http://example.com/foo?name=sue"
Example #4
0
def test_removing_search_value_and_key_from_uri_given_key():
  uri = URI('http://example.com/foo?bar=baz')
  assert uri.removeSearch(['bar']).toString() == 'http://example.com/foo'
Example #5
0
def test_removeQuery_is_same_as_removeSearch():
    uri = URI('http://example.com/foo?bar=baz')
    assert uri.removeQuery(['bar'
                            ]).toString() == uri.removeSearch(['bar'
                                                               ]).toString()
Example #6
0
def test_removing_only_keys_with_given_value_from_uri():
    uri = URI("http://example.com/foo?bar=baz&name=sue")
    assert uri.removeSearch(
        ['bar'], 'baz').toString() == "http://example.com/foo?name=sue"
Example #7
0
def test_removing_multiple_search_keys_and_values_from_uri_given_keys():
    uri = URI('http://example.com/foo?bar=baz&sam=sue')
    assert uri.removeSearch(['bar',
                             'sam']).toString() == 'http://example.com/foo'
Example #8
0
def test_removing_search_value_and_key_from_uri_given_key():
    uri = URI('http://example.com/foo?bar=baz')
    assert uri.removeSearch(['bar']).toString() == 'http://example.com/foo'