;
Íâ"Ic               @   s8  d  d l  m Z d  d l Z d  d l Z d Z d Z d Z d g  f d g  f d g  f d d d f g f d	 d d
 f g f d
 d
 d f g f d d
 d f g f d d
 d f g f d d
 d f g f d d
 d f d d f g f d d
 d f d
 d f g f g Z Gd „  d e j	 ƒ Z
 d „  Z e d k o e ƒ  n d S(   i    (   u   supportNu   http://a/b/c/d;p?q#fu   http://a/b/c/d;p?qu    u   &u   &&u   =u   =au   au   a=u   &a=bu   bu   a=a+b&b=b+cu   a bu   b cu   a=1&a=2u   1u   2c             B   s•   |  Ee  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d S(   c             C   sP  t  j j | ƒ } |  j | | ƒ | j | j | j | j | j | j	 f } |  j | | ƒ t  j j
 | ƒ } |  j | | ƒ |  j | | j ƒ  ƒ t  j j | j ƒ  ƒ } |  j | j ƒ  | j ƒ  ƒ |  j | | ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j	 | j	 ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ t  j j | ƒ } |  j | | ƒ | j | j | j | j | j	 f } |  j | | ƒ t  j j | ƒ } |  j | | ƒ |  j | | j ƒ  ƒ t  j j | j ƒ  ƒ } |  j | j ƒ  | j ƒ  ƒ |  j | | ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j	 | j	 ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ |  j | j | j ƒ d  S(   N(   u   urllibu   parseu   urlparseu   assertEqualu   schemeu   netlocu   pathu   paramsu   queryu   fragmentu
   urlunparseu   geturlu   usernameu   passwordu   hostnameu   portu   urlsplitu
   urlunsplit(   u   selfu   urlu   parsedu   splitu   resultu   tu   result2u   result3(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   checkRoundtrips   sR    c             C   sP   xI t  D]A \ } } t j j | d d ƒ} |  j | | d t | ƒ ƒ q Wd  S(   Nu   keep_blank_valuesu   Error parsing %sT(   u   parse_qsl_test_casesu   urllibu   parseu	   parse_qslu   Trueu   assertEqualu   repr(   u   selfu   origu   expectu   result(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_qslQ   s     c          
   C   sg   d d d f d d d f d	 d d f d d d f g } x* | D]" \ } } } |  j  | | | ƒ q= Wd  S(   Nu   file:///tmp/junk.txtu   fileu    u   /tmp/junk.txtu   imap://mail.python.org/mbox1u   imapu   mail.python.orgu   /mbox1u1   mms://wms.sys.hinet.net/cts/Drama/09006251100.asfu   mmsu   wms.sys.hinet.netu   /cts/Drama/09006251100.asfu0   svn+ssh://svn.zope.org/repos/main/ZConfig/trunk/u   svn+sshu   svn.zope.orgu   /repos/main/ZConfig/trunk/(   u   fileu    u   /tmp/junk.txtu    u    u    (   u   fileu    u   /tmp/junk.txtu    u    (   u   imapu   mail.python.orgu   /mbox1u    u    u    (   u   imapu   mail.python.orgu   /mbox1u    u    (   u   mmsu   wms.sys.hinet.netu   /cts/Drama/09006251100.asfu    u    u    (   u   mmsu   wms.sys.hinet.netu   /cts/Drama/09006251100.asfu    u    (   u   svn+sshu   svn.zope.orgu   /repos/main/ZConfig/trunk/u    u    u    (   u   svn+sshu   svn.zope.orgu   /repos/main/ZConfig/trunk/u    u    (   u   checkRoundtrips(   u   selfu	   testcasesu   urlu   parsedu   split(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_roundtripsW   s&         c          
   C   s¨   d d d f d d d f d d d f d d d f d
 d d f g } x_ d D]W } xN | D]F \ } } } | | } | f | } | f | } |  j  | | | ƒ qV WqI Wd  S(   Nu   ://www.python.orgu   www.python.orgu    u   ://www.python.org#abcu   abcu   ://www.python.org?q=abcu   q=abcu   ://www.python.org/#abcu   /u   ://a/b/c/d;p?q#fu   au   /b/c/du   pu   qu   fu   /b/c/d;pu   httpu   https(   u   www.python.orgu    u    u    u    (   u   www.python.orgu    u    u    (   u   www.python.orgu    u    u    u   abc(   u   www.python.orgu    u    u   abc(   u   www.python.orgu    u    u   q=abcu    (   u   www.python.orgu    u   q=abcu    (   u   www.python.orgu   /u    u    u   abc(   u   www.python.orgu   /u    u   abc(   u   au   /b/c/du   pu   qu   f(   u   au   /b/c/d;pu   qu   f(   u   httpu   https(   u   checkRoundtrips(   u   selfu	   testcasesu   schemeu   urlu   parsedu   split(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_http_roundtripsm   s.      
c             C   s/   |  j  t j j | | ƒ | | | | f ƒ d  S(   N(   u   assertEqualu   urllibu   parseu   urljoin(   u   selfu   baseu   relurlu   expected(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu	   checkJoin‰   s    c             C   sk   xd d d g D]V } |  j  t j j t j j | ƒ ƒ | ƒ |  j  t j j t j j | ƒ ƒ | ƒ q Wd  S(   Nu   Pythonu   ./Python(   u   assertEqualu   urllibu   parseu
   urlunsplitu   urlsplitu
   urlunparseu   urlparse(   u   selfu   u(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_unparse_parse   s     (c             C   s  |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d	 d
 ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d  d ƒ |  j  t d! d" ƒ |  j  t d# d$ ƒ |  j  t d% d$ ƒ |  j  t d& d ƒ |  j  t d' d( ƒ |  j  t d) d* ƒ |  j  t d+ d, ƒ |  j  t d- d. ƒ |  j  t d/ d* ƒ |  j  t d0 d1 ƒ |  j  t d2 d3 ƒ |  j  t d4 d5 ƒ |  j  t d6 d7 ƒ |  j  t d8 d" ƒ |  j  t d9 d ƒ |  j  t d: d; ƒ |  j  t d< d= ƒ d  S(>   Nu   g:hu   gu   http://a/b/c/gu   ./gu   g/u   http://a/b/c/g/u   /gu
   http://a/gu   //gu   http://gu   g?yu   http://a/b/c/g?yu   g?y/./xu   http://a/b/c/g?y/./xu   #su   http://a/b/c/d;p?q#su   g#su   http://a/b/c/g#su   g#s/./xu   http://a/b/c/g#s/./xu   g?y#su   http://a/b/c/g?y#su   g;xu   http://a/b/c/g;xu   g;x?y#su   http://a/b/c/g;x?y#su   .u   http://a/b/c/u   ./u   ..u   http://a/b/u   ../u   ../gu   http://a/b/gu   ../..u	   http://a/u   ../../u   ../../gu    u   http://a/b/c/d;p?q#fu
   ../../../gu   http://a/../gu   ../../../../gu   http://a/../../gu   /./gu   http://a/./gu   /../gu   g.u   http://a/b/c/g.u   .gu   http://a/b/c/.gu   g..u   http://a/b/c/g..u   ..gu   http://a/b/c/..gu   ./../gu   ./g/.u   g/./hu   http://a/b/c/g/hu   g/../hu   http://a/b/c/h(   u	   checkJoinu   RFC1808_BASE(   u   self(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_RFC1808’   sF    c             C   sé  |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d	 d
 ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d ƒ |  j  t d d  ƒ |  j  t d! d  ƒ |  j  t d" d ƒ |  j  t d# t ƒ |  j  t d$ d% ƒ |  j  t d& d' ƒ |  j  t d( d) ƒ |  j  t d* d% ƒ |  j  t d+ d, ƒ |  j  t d- d. ƒ |  j  t d/ d0 ƒ |  j  t d1 d2 ƒ |  j  t d3 d ƒ |  j  t d4 d ƒ |  j  t d5 d6 ƒ |  j  t d7 d8 ƒ |  j  t d9 d: ƒ |  j  t d; d< ƒ |  j  t d= d> ƒ |  j  t d? d@ ƒ |  j  t dA dB ƒ |  j  t dC dD ƒ d  S(E   Nu   g:hu   gu   http://a/b/c/gu   ./gu   g/u   http://a/b/c/g/u   /gu
   http://a/gu   //gu   http://gu   g?yu   http://a/b/c/g?yu   #su   http://a/b/c/d;p?q#su   g#su   http://a/b/c/g#su   g?y#su   http://a/b/c/g?y#su   g;xu   http://a/b/c/g;xu   g;x?y#su   http://a/b/c/g;x?y#su   .u   http://a/b/c/u   ./u   ..u   http://a/b/u   ../u   ../gu   http://a/b/gu   ../..u	   http://a/u   ../../u   ../../gu    u
   ../../../gu   http://a/../gu   ../../../../gu   http://a/../../gu   /./gu   http://a/./gu   /../gu   g.u   http://a/b/c/g.u   .gu   http://a/b/c/.gu   g..u   http://a/b/c/g..u   ..gu   http://a/b/c/..gu   ./../gu   ./g/.u   g/./hu   http://a/b/c/g/hu   g/../hu   http://a/b/c/hu	   g;x=1/./yu   http://a/b/c/g;x=1/yu
   g;x=1/../yu   http://a/b/c/yu   g?y/./xu   http://a/b/c/g?y/./xu   g?y/../xu   http://a/b/c/g?y/../xu   g#s/./xu   http://a/b/c/g#s/./xu   g#s/../xu   http://a/b/c/g#s/../x(   u	   checkJoinu   RFC2396_BASE(   u   self(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_RFC2396¿   sN    c             C   s*   |  j  t d d ƒ |  j  t d d ƒ d  S(   Nu   ?yu   http://a/b/c/d;p?yu   ;xu   http://a/b/c/;x(   u	   checkJoinu   RFC3986_BASEu   RFC2396_BASE(   u   self(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_RFC3986ï   s    c             C   sp   xi d d d d d d d d t  d d f t d d f g
 D]1 \ } } } |  j t j j | ƒ | | f ƒ q7 Wd  S(   Nu   http://python.org#fragu   http://python.orgu   fragu    u   http://python.org/#fragu   http://python.org/u   http://python.org/?q#fragu   http://python.org/?qu   http://python.org/p#fragu   http://python.org/pu   http://python.org/p?qu   http://a/b/c/d;p?qu   f(   u   http://python.org#fragu   http://python.orgu   frag(   u   http://python.orgu   http://python.orgu    (   u   http://python.org/#fragu   http://python.org/u   frag(   u   http://python.org/u   http://python.org/u    (   u   http://python.org/?q#fragu   http://python.org/?qu   frag(   u   http://python.org/?qu   http://python.org/?qu    (   u   http://python.org/p#fragu   http://python.org/pu   frag(   u   http://python.org/p?qu   http://python.org/p?qu    (   u   RFC1808_BASEu   RFC2396_BASEu   assertEqualu   urllibu   parseu	   urldefrag(   u   selfu   urlu   defragu   frag(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_urldefragó   s     c             C   sy  d } t  j j | ƒ } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j	 d  ƒ |  j | j d  ƒ |  j | j d ƒ |  j | j d  ƒ d } t  j j | ƒ } |  j | j d ƒ |  j | j d	 ƒ |  j | j d ƒ |  j | j d
 ƒ |  j | j d ƒ |  j | j	 d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j ƒ  | ƒ d } t  j j | ƒ } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d
 ƒ |  j | j d ƒ |  j | j	 d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j ƒ  | ƒ d  S(   Nu   HTTP://WWW.PYTHON.ORG/doc/#fragu   httpu   WWW.PYTHON.ORGu   /doc/u    u   fragu   www.python.orgu7   http://User:Pass@www.python.org:080/doc/?query=yes#fragu   User:Pass@www.python.org:080u	   query=yesu   Useru   PassiP   uC   http://User@example.com:Pass@www.python.org:080/doc/?query=yes#fragu(   User@example.com:Pass@www.python.org:080u   User@example.com(   u   urllibu   parseu   urlsplitu   assertEqualu   schemeu   netlocu   pathu   queryu   fragmentu   usernameu   Noneu   passwordu   hostnameu   portu   geturl(   u   selfu   urlu   p(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_urlsplit_attributes  sF    c                s€   t  j j d ƒ ‰  |  j ˆ  j d ƒ |  j t ‡  f d †  ƒ t  j j d ƒ ‰  |  j ˆ  j d ƒ |  j t ‡  f d †  ƒ d S(   u$   Check handling of non-integer ports.u   http://www.example.net:foou   www.example.net:fooc                  s   ˆ  j  S(    (   u   port(    (   u   p(    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   <lambda>5  s    c                  s   ˆ  j  S(    (   u   port(    (   u   p(    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   <lambda>9  s    N(   u   urllibu   parseu   urlsplitu   assertEqualu   netlocu   assertRaisesu
   ValueErroru   urlparse(   u   self(    (   u   pu/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_attributes_bad_port1  s    c             C   s  d } t  j j | ƒ } |  j | j d ƒ |  j | j d  ƒ |  j | j d  ƒ |  j | j d  ƒ |  j | j	 d  ƒ |  j | j
 ƒ  | ƒ t  j j | ƒ } |  j | j d ƒ |  j | j d  ƒ |  j | j d  ƒ |  j | j d  ƒ |  j | j	 d  ƒ |  j | j
 ƒ  | ƒ d  S(   Nu0   sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15u    (   u   urllibu   parseu   urlsplitu   assertEqualu   netlocu   usernameu   Noneu   passwordu   hostnameu   portu   geturlu   urlparse(   u   selfu   uriu   p(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_attributes_without_netloc;  s    c             C   s    |  j  t j j d ƒ d ƒ d  S(   Nu    http://example.com?blahblah=/foou   httpu   example.comu    u   blahblah=/foo(   u   httpu   example.comu    u    u   blahblah=/foou    (   u   assertEqualu   urllibu   parseu   urlparse(   u   self(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_noslashR  s    c             C   s   |  j  t t j j d ƒ d  S(   Nu   foo(   u   assertRaisesu	   TypeErroru   urllibu   parseu	   urlencode(   u   self(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   test_usingsysW  s    N(   u   __name__u
   __module__u   checkRoundtripsu   test_qslu   test_roundtripsu   test_http_roundtripsu	   checkJoinu   test_unparse_parseu   test_RFC1808u   test_RFC2396u   test_RFC3986u   test_urldefragu   test_urlsplit_attributesu   test_attributes_bad_portu   test_attributes_without_netlocu   test_noslashu   test_usingsys(   u
   __locals__(    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   UrlParseTestCase   s   
	3						-	0			/	
		u   UrlParseTestCasec               C   s   t  j t ƒ d  S(   N(   u   supportu   run_unittestu   UrlParseTestCase(    (    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu	   test_main[  s    u   __main__(   u   testu   supportu   unittestu   urllib.parseu   urllibu   RFC1808_BASEu   RFC2396_BASEu   RFC3986_BASEu   parse_qsl_test_casesu   TestCaseu   UrlParseTestCaseu	   test_mainu   __name__(    (    (    u/   /mit/python/lib/python3.0/test/test_urlparse.pyu   <module>   s*   			!ÿ @	