MCPcopy Index your code
hub / github.com/clips/pattern / test_abs

Method test_abs

test/test_web.py:215–228  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 1

absMethod · 0.80

Tested by

no test coverage detected