Пример #1
0
 def test_params_are_added_before_fragment(self):
     """
     Testing the correct order or url encoding
     """
     r = request("coap://example.com/path#fragment", params={"a": "b"})
     self.assertEqual(r.full_url, "coap://example.com/path?a=b#fragment")
     r = request("coap://example.com/path?key=value#fragment",
                 params={"a": "b"})
     self.assertEqual(r.full_url,
                      "coap://example.com/path?key=value&a=b#fragment")
Пример #2
0
 def test_params_accepts_kv_list(self):
     """
     Testing parameters encoding
     """
     r = request('coap://example.com/path', params=[('a', 'b')])
     self.assertEqual(r.full_url, 'coap://example.com/path?a=b')