def test_update_query_params_repeated_params(self):
     uri = 'http://www.google.com?x=a&x=b'
     with self.assertRaises(ValueError):
         _helpers.update_query_params(uri, {'a': 'c'})
 def test_update_query_params_existing_params(self):
     uri = 'http://www.google.com?x=y'
     updated = _helpers.update_query_params(uri, {'a': 'b', 'c': 'd&'})
     hardcoded_update = uri + '&a=b&c=d%26'
     assertUrisEqual(self, updated, hardcoded_update)
 def test_update_query_params_replace_param(self):
     base_uri = 'http://www.google.com'
     uri = base_uri + '?x=a'
     updated = _helpers.update_query_params(uri, {'x': 'b', 'y': 'c'})
     hardcoded_update = base_uri + '?x=b&y=c'
     assertUrisEqual(self, updated, hardcoded_update)
Пример #4
0
 def test_update_query_params_repeated_params(self):
     uri = 'http://www.google.com?x=a&x=b'
     with self.assertRaises(ValueError):
         _helpers.update_query_params(uri, {'a': 'c'})
 def test_update_query_params_no_params(self):
     uri = 'http://www.google.com'
     updated = _helpers.update_query_params(uri, {'a': 'b'})
     self.assertEqual(updated, uri + '?a=b')
Пример #6
0
 def test_update_query_params_existing_params(self):
     uri = 'http://www.google.com?x=y'
     updated = _helpers.update_query_params(uri, {'a': 'b', 'c': 'd&'})
     hardcoded_update = uri + '&a=b&c=d%26'
     assertUrisEqual(self, updated, hardcoded_update)
Пример #7
0
 def test_update_query_params_replace_param(self):
     base_uri = 'http://www.google.com'
     uri = base_uri + '?x=a'
     updated = _helpers.update_query_params(uri, {'x': 'b', 'y': 'c'})
     hardcoded_update = base_uri + '?x=b&y=c'
     assertUrisEqual(self, updated, hardcoded_update)
Пример #8
0
 def test_update_query_params_no_params(self):
     uri = 'http://www.google.com'
     updated = _helpers.update_query_params(uri, {'a': 'b'})
     self.assertEqual(updated, uri + '?a=b')
 def test_update_query_params_repeated_params(self):
     uri = "http://www.google.com?x=a&x=b"
     with self.assertRaises(ValueError):
         _helpers.update_query_params(uri, {"a": "c"})
 def test_update_query_params_replace_param(self):
     base_uri = "http://www.google.com"
     uri = base_uri + "?x=a"
     updated = _helpers.update_query_params(uri, {"x": "b", "y": "c"})
     hardcoded_update = base_uri + "?x=b&y=c"
     assertUrisEqual(self, updated, hardcoded_update)
 def test_update_query_params_existing_params(self):
     uri = "http://www.google.com?x=y"
     updated = _helpers.update_query_params(uri, {"a": "b", "c": "d&"})
     hardcoded_update = uri + "&a=b&c=d%26"
     assertUrisEqual(self, updated, hardcoded_update)
 def test_update_query_params_no_params(self):
     uri = "http://www.google.com"
     updated = _helpers.update_query_params(uri, {"a": "b"})
     self.assertEqual(updated, uri + "?a=b")