| 213 | print "pattern.web.URL.redirect: " + self.live + " => " + str(v) |
| 214 | |
| 215 | def test_abs(self): |
| 216 | # Assert absolute URL (special attention for anchors). |
| 217 | for a, b in ( |
| 218 | ("../page.html", "http://domain.com/path/"), |
| 219 | ( "page.html", "http://domain.com/home.html")): |
| 220 | v = web.abs(a, base=b) |
| 221 | self.assertEqual(v, "http://domain.com/page.html") |
| 222 | for a, b, c in ( |
| 223 | ( "#anchor", "http://domain.com", "/"), |
| 224 | ( "#anchor", "http://domain.com/", ""), |
| 225 | ( "#anchor", "http://domain.com/page", "")): |
| 226 | v = web.abs(a, base=b) |
| 227 | self.assertEqual(v, b+c+a) # http://domain.com/#anchor |
| 228 | print "pattern.web.abs()" |
| 229 | |
| 230 | def test_base(self): |
| 231 | # Assert base URL domain name. |