def test_set_params_with_multiple_values_sets_the_same_name_multiple_times(self):
     s = QueryString('foo=spam')
     assert (s.set_params({'foo': ['bar', 'baz']}) ==
             'foo=bar&foo=baz')
     s2 = QueryString('foo=bar&foo=baz')
     assert (s2.set_params({'foo': ['spam', 'ham']}) ==
             'foo=spam&foo=ham')
Exemple #2
0
 def test_set_params_with_multiple_values_sets_the_same_name_multiple_times(self):
     s = QueryString(u'foo=spam')
     assert (s.set_params({u'foo': [u'bar', u'baz']}) ==
             u'foo=bar&foo=baz')
     s2 = QueryString(u'foo=bar&foo=baz')
     assert (s2.set_params({u'foo': [u'spam', u'ham']}) ==
             u'foo=spam&foo=ham')
Exemple #3
0
 def test_set_params_accepts_the_same_args_as_dict(self):
     s = QueryString(u'')
     added = s.set_params({u'abc': u'123'}, abc='456')
     assert added.dict == {u'abc': u'456'}
     added2 = s.set_params([(u'abc', u'123')], abc=u'456')
     assert added2.dict == {u'abc': u'456'}
Exemple #4
0
 def test_set_params_is_equivalent_to_calling_set_param_multiple_times(self):
     s = QueryString(u'')
     assert (s.set_params([(u'abc', u'123'), (u'def', u'456')]) ==
             s.set_param(u'abc', u'123').set_param(u'def', u'456'))
 def test_set_params_accepts_the_same_args_as_dict(self):
     s = QueryString('')
     added = s.set_params({'abc': '123'}, abc='456')
     assert added.dict == {'abc': '456'}
     added2 = s.set_params([('abc', '123')], abc='456')
     assert added2.dict == {'abc': '456'}
 def test_set_params_is_equivalent_to_calling_set_param_multiple_times(self):
     s = QueryString('')
     assert (s.set_params([('abc', '123'), ('def', '456')]) ==
             s.set_param('abc', '123').set_param('def', '456'))
 def test_set_params_with_multiple_values_sets_the_same_name_multiple_times(self):
     s = QueryString("foo=spam")
     assert s.set_params({"foo": ["bar", "baz"]}) == "foo=bar&foo=baz"
     s2 = QueryString("foo=bar&foo=baz")
     assert s2.set_params({"foo": ["spam", "ham"]}) == "foo=spam&foo=ham"
 def test_set_params_accepts_the_same_args_as_dict(self):
     s = QueryString("")
     added = s.set_params({"abc": "123"}, abc="456")
     assert added.dict == {"abc": "456"}
     added2 = s.set_params([("abc", "123")], abc="456")
     assert added2.dict == {"abc": "456"}
 def test_set_params_is_equivalent_to_calling_set_param_multiple_times(self):
     s = QueryString("")
     assert s.set_params([("abc", "123"), ("def", "456")]) == s.set_param("abc", "123").set_param("def", "456")