예제 #1
0
파일: test_uri.py 프로젝트: staverne/itools
    def test_urlspslit_uri(self):
        a = 'http://example.com/'
        b = ('http', 'example.com', '/', '', '')
        self.assertEqual(parse_uri(a), b)

        a = 'http://example.com/a/b/c?x=1&y=5#top'
        b = ('http', 'example.com', '/a/b/c', 'x=1&y=5', 'top')
        self.assertEqual(parse_uri(a), b)

        a = 'file:///a/b/c?x=1&y=5#top'
        b = ('file', '', '/a/b/c', 'x=1&y=5', 'top')
        self.assertEqual(parse_uri(a), b)
예제 #2
0
파일: test_uri.py 프로젝트: staverne/itools
    def test_urlsplit_section_1_1_2(self):
        """Test the examples from RFC 3986, Section 1.1.2
        """
        a = 'ftp://ftp.is.co.za/rfc/rfc1808.txt'
        b = ('ftp', 'ftp.is.co.za', '/rfc/rfc1808.txt', '', '')
        self.assertEqual(parse_uri(a), b)

        a = 'http://www.ietf.org/rfc/rfc2396.txt'
        b = ('http', 'www.ietf.org', '/rfc/rfc2396.txt', '', '')
        self.assertEqual(parse_uri(a), b)

        a = 'ldap://[2001:db8::7]/c=GB?objectClass?one'
        b = ('ldap', '[2001:db8::7]', '/c=GB', 'objectClass?one', '')
        self.assertEqual(parse_uri(a), b)
예제 #3
0
파일: test_uri.py 프로젝트: staverne/itools
 def test_urlspslit_relative_reference(self):
     a = '//example.com/a/b/c?x=1&y=5#top'
     b = ('', 'example.com', '/a/b/c', 'x=1&y=5', 'top')
     self.assertEqual(parse_uri(a), b)