MCPcopy Index your code
hub / github.com/python/cpython / test_RFC1808

Method test_RFC1808

Lib/test/test_urlparse.py:400–445  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

398 self.assertEqual(urllib.parse.urlunparse(urllib.parse.urlparse(u)), u)
399
400 def test_RFC1808(self):
401 # "normal" cases from RFC 1808:
402 self.checkJoin(RFC1808_BASE, 'g:h', 'g:h')
403 self.checkJoin(RFC1808_BASE, 'g', 'http://a/b/c/g')
404 self.checkJoin(RFC1808_BASE, './g', 'http://a/b/c/g')
405 self.checkJoin(RFC1808_BASE, 'g/', 'http://a/b/c/g/')
406 self.checkJoin(RFC1808_BASE, '/g', 'http://a/g')
407 self.checkJoin(RFC1808_BASE, '//g', 'http://g')
408 self.checkJoin(RFC1808_BASE, 'g?y', 'http://a/b/c/g?y')
409 self.checkJoin(RFC1808_BASE, 'g?y/./x', 'http://a/b/c/g?y/./x')
410 self.checkJoin(RFC1808_BASE, '#s', 'http://a/b/c/d;p?q#s')
411 self.checkJoin(RFC1808_BASE, 'g#s', 'http://a/b/c/g#s')
412 self.checkJoin(RFC1808_BASE, 'g#s/./x', 'http://a/b/c/g#s/./x')
413 self.checkJoin(RFC1808_BASE, 'g?y#s', 'http://a/b/c/g?y#s')
414 self.checkJoin(RFC1808_BASE, 'g;x', 'http://a/b/c/g;x')
415 self.checkJoin(RFC1808_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s')
416 self.checkJoin(RFC1808_BASE, '.', 'http://a/b/c/')
417 self.checkJoin(RFC1808_BASE, './', 'http://a/b/c/')
418 self.checkJoin(RFC1808_BASE, '..', 'http://a/b/')
419 self.checkJoin(RFC1808_BASE, '../', 'http://a/b/')
420 self.checkJoin(RFC1808_BASE, '../g', 'http://a/b/g')
421 self.checkJoin(RFC1808_BASE, '../..', 'http://a/')
422 self.checkJoin(RFC1808_BASE, '../../', 'http://a/')
423 self.checkJoin(RFC1808_BASE, '../../g', 'http://a/g')
424
425 # "abnormal" cases from RFC 1808:
426 self.checkJoin(RFC1808_BASE, None, 'http://a/b/c/d;p?q#f')
427 self.checkJoin(RFC1808_BASE, 'g.', 'http://a/b/c/g.')
428 self.checkJoin(RFC1808_BASE, '.g', 'http://a/b/c/.g')
429 self.checkJoin(RFC1808_BASE, 'g..', 'http://a/b/c/g..')
430 self.checkJoin(RFC1808_BASE, '..g', 'http://a/b/c/..g')
431 self.checkJoin(RFC1808_BASE, './../g', 'http://a/b/g')
432 self.checkJoin(RFC1808_BASE, './g/.', 'http://a/b/c/g/')
433 self.checkJoin(RFC1808_BASE, 'g/./h', 'http://a/b/c/g/h')
434 self.checkJoin(RFC1808_BASE, 'g/../h', 'http://a/b/c/h')
435
436 # RFC 1808 and RFC 1630 disagree on these (according to RFC 1808),
437 # so we'll not actually run these tests (which expect 1808 behavior).
438 #self.checkJoin(RFC1808_BASE, 'http:g', 'http:g')
439 #self.checkJoin(RFC1808_BASE, 'http:', 'http:')
440
441 # XXX: The following tests are no longer compatible with RFC3986
442 # self.checkJoin(RFC1808_BASE, '../../../g', 'http://a/../g')
443 # self.checkJoin(RFC1808_BASE, '../../../../g', 'http://a/../../g')
444 # self.checkJoin(RFC1808_BASE, '/./g', 'http://a/./g')
445 # self.checkJoin(RFC1808_BASE, '/../g', 'http://a/../g')
446
447
448 def test_RFC2368(self):

Callers

nothing calls this directly

Calls 1

checkJoinMethod · 0.95

Tested by

no test coverage detected