Example #1
0
    def test_create(self):
        u = Url("http://example.com/path/part/?query1=val1")
        self.assertEqual("http://example.com/path/part", u.base())
        self.assertEqual({"query1": "val1"}, u.query_kwargs)

        u2 = u.host("/foo/bar", query1="val2")
        self.assertEqual("http://example.com/foo/bar?query1=val2", u2)
Example #2
0
 def test_host(self):
     u = Url("http://example.com/path/part/?che=3")
     u2 = u.host("foo", "bar", che=4)
     self.assertEqual("http://example.com/foo/bar?che=4", u2)
     self.assertEqual(u2.host(), u.host())