;
Ëâ"Ic            	   @   sÝ   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l m Z Gd „  d e j ƒ Z Gd „  d e j ƒ Z	 Gd „  d e	 ƒ Z
 Gd	 „  d
 e	 ƒ Z Gd „  d e
 ƒ Z Gd „  d e ƒ Z d „  Z e d k o e ƒ  n d S(   i    N(   u   supportc             B   sJ   |  Ee  Z d  „  Z d „  Z d „  Z d „  Z d „  Z e Z d „  Z d S(   c             C   s   t  |  j j ƒ  ƒ S(   N(   u   sortedu   datau   items(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   items	   s    c             C   s   t  |  j j ƒ  ƒ S(   N(   u   sortedu   datau   keys(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   keys   s    c             C   s   d „  |  j  ƒ  Dƒ S(   Nc             S   s   g  } |  ] } | | d  q
 S(   i   (    (   u   .0u   _[1]u   i(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   <listcomp>   s    (   u   items(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   values   s    c             C   s   t  |  j ƒ  ƒ S(   N(   u   iteru   items(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu	   iteritems   s    c             C   s   t  |  j ƒ  ƒ S(   N(   u   iteru   keys(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   iterkeys   s    c             C   s   t  |  j ƒ  ƒ S(   N(   u   iteru   values(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   itervalues   s    N(	   u   __name__u
   __module__u   itemsu   keysu   valuesu	   iteritemsu   iterkeysu   __iter__u
   itervalues(   u
   __locals__(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   SortedDict   s   
					u
   SortedDictc             B   s¤   |  Ee  Z d d  „ Z d 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   s9   | d  k o |  j ƒ  |  _ n |  j | ƒ |  _ |  j S(   N(   u   Noneu   config_classu   cf(   u   selfu   defaults(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu	   newconfig   s    c             C   s/   |  j  | ƒ } t j | ƒ } | j | ƒ | S(   N(   u	   newconfigu   iou   StringIOu   readfp(   u   selfu   stringu   defaultsu   cfu   sio(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   fromstring   s    c          	   C   sy  |  j  d ƒ } | j ƒ  } | j ƒ  |  j } | | d d d d d d d g ƒ | | j d d	 ƒ d
 ƒ | | j d d	 ƒ d
 ƒ | | j d d	 ƒ d
 ƒ | | j d d ƒ d ƒ | | j d d ƒ d ƒ |  j d | j d ƒ k d ƒ |  j | j d d	 ƒ d ƒ |  j | j	 d d	 ƒ d ƒ |  j | j d d	 ƒ d ƒ |  j
 t j | j d d	 ƒ | | j d d	 ƒ d ƒ d  S(   NuQ  [Foo Bar]
foo=bar
[Spacey Bar]
foo = bar
[Commented Bar]
foo: bar ; comment
[Long Line]
foo: this line is much, much longer than my editor
   likes it.
[Section\with$weird%characters[	]
[Internationalized Stuff]
foo[bg]: Bulgarian
foo=Default
foo[en]=English
foo[de]=Deutsch
[Spaces]
key with spaces : value
another with spaces = splat!
u   Commented Baru   Foo Baru   Internationalized Stuffu	   Long Lineu   Section\with$weird%characters[	u   Spacesu
   Spacey Baru   foou   baru   key with spacesu   valueu   another with spacesu   splat!u   __name__u3   __name__ "option" should not be exposed by the API!u4   remove_option() failed to report existance of optionu'   remove_option() failed to remove optionuI   remove_option() failed to report non-existance of option that was removedu   No Such Sectionu7   this line is much, much longer than my editor
likes it.(   u
   fromstringu   sectionsu   sortu   assertEqualu   getu   failIfu   optionsu
   failUnlessu   remove_optionu
   has_optionu   assertRaisesu   configparseru   NoSectionError(   u   selfu   cfu   Lu   eq(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   test_basic%   s:    	
		
c             C   sË  |  j  ƒ  } | j d ƒ | j d ƒ | j ƒ  } | j ƒ  |  j } | | d d g ƒ | j d d d ƒ | | j d ƒ d g ƒ | | j d d ƒ d d ƒ |  j | j	 d d ƒ ƒ | j d d d ƒ x* d D]" } |  j | j	 d | ƒ d ƒ qÓ W| | j d ƒ d	 g ƒ | | j d ƒ d g ƒ | j
 d d ƒ | | j d ƒ g  ƒ |  j d ƒ } | | j d ƒ d g ƒ | | j d d ƒ d ƒ |  j d d i d d 6ƒ} |  j | j	 d d ƒ ƒ d  S(   Nu   Au   au   Bu   valueu   bu@   could not locate option, expecting case-insensitive option namesu   A-Bu	   A-B valueu   a-bu   A-bu   a-Bu9   has_option() returned false for option which should existu,   [MySection]
Option: first line
	second line
u	   MySectionu   optionu   Optionu   first line
second lineu   [section]
nekey=nevalue
u   defaultsu   keyu   sectionu   Key(   u   a-bu   A-bu   a-Bu   A-B(   u	   newconfigu   add_sectionu   sectionsu   sortu   assertEqualu   setu   optionsu   getu
   failUnlessu
   has_optionu   remove_optionu
   fromstring(   u   selfu   cfu   Lu   equ   opt(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_case_sensitivityb   s:    
	 	c             C   sn   |  j  i d d 6ƒ } |  j | j d d ƒ d d ƒ |  j  i d d 6ƒ } |  j | j d d ƒ d d ƒ d  S(   Nu   Baru   foou   DEFAULTu   Foou@   could not locate option, expecting case-insensitive option namesu<   could not locate option, expecting case-insensitive defaults(   u	   newconfigu   assertEqualu   get(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_default_case_sensitivity…   s    c             C   s€   |  j  ƒ  |  j t j d ƒ |  j t j d ƒ |  j t j d ƒ |  j t j d ƒ |  j t j d ƒ |  j t j d ƒ d  S(   Nu   [Foo]
  extra-spaces: splat
u   [Foo]
  extra-spaces= splat
u   [Foo]
option-without-value
u!   [Foo]
:value-without-option-name
u!   [Foo]
=value-without-option-name
u   No Section!
(   u	   newconfigu   parse_erroru   configparseru   ParsingErroru   MissingSectionHeaderError(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_parse_errors   s    
c             C   s,   t  j | ƒ } |  j | |  j j | ƒ d  S(   N(   u   iou   StringIOu   assertRaisesu   cfu   readfp(   u   selfu   excu   srcu   sio(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   parse_errorž   s    c             C   s³   |  j  ƒ  } |  j | j ƒ  g  d ƒ |  j | j d ƒ d ƒ |  j t j | j d ƒ |  j t j | j	 d d d ƒ |  j
 t j d d ƒ | j d ƒ |  j
 t j d d ƒ d  S(   Nu0   new ConfigParser should have no defined sectionsu   Foou5   new ConfigParser should have no acknowledged sectionsu   foou   baru   value(   u	   newconfigu   assertEqualu   sectionsu   failIfu   has_sectionu   assertRaisesu   configparseru   NoSectionErroru   optionsu   setu	   get_erroru   add_sectionu   NoOptionError(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_query_errors¢   s    c             C   sf   y |  j  j | | ƒ Wn+ | k
 o } z	 | SWYd  d  } ~ Xn X|  j d | j | j f ƒ d  S(   Nu   expected exception type %s.%s(   u   cfu   getu   failu
   __module__u   __name__(   u   selfu   excu   sectionu   optionu   e(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu	   get_error°   s    	c             C   s„   |  j  d ƒ } xn t d d ƒ D]] } |  j | j d d | ƒ ƒ |  j | j d d | ƒ ƒ |  j t | j d d | ƒ q Wd  S(   Nu{   [BOOLTEST]
T1=1
T2=TRUE
T3=True
T4=oN
T5=yes
F1=0
F2=FALSE
F3=False
F4=oFF
F5=nO
E1=2
E2=foo
E3=-1
E4=0.1
E5=FALSE AND MOREi   i   u   BOOLTESTu   t%du   f%du   e%d(   u
   fromstringu   rangeu
   failUnlessu
   getbooleanu   failIfu   assertRaisesu
   ValueError(   u   selfu   cfu   x(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_boolean¹   s    	 	c             C   s6   |  j  ƒ  } | j d ƒ |  j t j | j d ƒ d  S(   Nu   Foo(   u	   newconfigu   add_sectionu   assertRaisesu   configparseru   DuplicateSectionError(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_weird_errorsÒ   s    c             C   sB   |  j  d ƒ } t j ƒ  } | j | ƒ |  j | j ƒ  d ƒ d  S(   Nur   [Long Line]
foo: this line is much, much longer than my editor
   likes it.
[DEFAULT]
foo: another very
 long lineuu   [DEFAULT]
foo = another very
	long line

[Long Line]
foo = this line is much, much longer than my editor
	likes it.

(   u
   fromstringu   iou   StringIOu   writeu   assertEqualu   getvalue(   u   selfu   cfu   output(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   test_writeØ   s    		c             C   s¤   |  j  d ƒ } Gd „  d t ƒ } | j d d d ƒ | j d d | d ƒ ƒ | j d d d ƒ | j d d | d ƒ ƒ | j d d d ƒ | j d d d ƒ d  S(   Nu   [sect]
option1=foo
c             B   s   |  Ee  Z d  S(   N(   u   __name__u
   __module__(   u
   __locals__(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   mystrô   s   
u   mystru   sectu   option1u   splatu   option2(   u
   fromstringu   stru   set(   u   selfu   cfu   mystr(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_set_string_typesï   s    c             C   s  t  j d ƒ } |  j ƒ  } | j | d g ƒ } |  j | | g ƒ |  j | j d d ƒ d ƒ |  j ƒ  } | j | ƒ } |  j | | g ƒ |  j | j d d ƒ d ƒ |  j ƒ  } | j d g ƒ } |  j | g  ƒ |  j ƒ  } | j g  ƒ } |  j | g  ƒ d  S(   Nu   cfgparser.1u   nonexistant-fileu   Foo Baru   foou   newbar(   u   supportu   findfileu	   newconfigu   readu   assertEqualu   get(   u   selfu   file1u   cfu   parsed_files(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_read_returns_file_listý   s    c             C   s   |  j  d d i d d 6ƒS(   Nuê  [Foo]
bar=something %(with1)s interpolation (1 step)
bar9=something %(with9)s lots of interpolation (9 steps)
bar10=something %(with10)s lots of interpolation (10 steps)
bar11=something %(with11)s lots of interpolation (11 steps)
with11=%(with10)s
with10=%(with9)s
with9=%(with8)s
with8=%(With7)s
with7=%(WITH6)s
with6=%(with5)s
With5=%(with4)s
WITH4=%(with3)s
with3=%(with2)s
with2=%(with1)s
with1=with

[Mutual Recursion]
foo=%(bar)s
bar=%(foo)s

[Interpolation Error]
name=%(reference)s
u   defaultsu   %(__name__)su   getname(   u
   fromstring(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   get_interpolation_config  s    c             C   sO   |  j  d d i d d 6ƒ} t | j d ƒ ƒ } | j ƒ  |  j | | ƒ d  S(   NuY   [section]
name = value
key: |%(name)s| 
getdefault: |%(default)s|
getname: |%(__name__)s|u   defaultsu	   <default>u   defaultu   section(   u
   fromstringu   listu   itemsu   sortu   assertEqual(   u   selfu   expectedu   cfu   L(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   check_items_config/  s    
N(   u   __name__u
   __module__u   Noneu	   newconfigu
   fromstringu
   test_basicu   test_case_sensitivityu   test_default_case_sensitivityu   test_parse_errorsu   parse_erroru   test_query_errorsu	   get_erroru   test_booleanu   test_weird_errorsu
   test_writeu   test_set_string_typesu   test_read_returns_file_listu   get_interpolation_configu   check_items_config(   u
   __locals__(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   TestCaseBase   s    
	=	#	
											u   TestCaseBasec             B   s;   |  Ee  Z e j Z d  „  Z d „  Z d „  Z d „  Z d S(   c             C   s“   |  j  ƒ  } |  j } | | j d d ƒ d ƒ | | j d d ƒ d ƒ | | j d d ƒ d ƒ | | j d d ƒ d ƒ |  j t j d d	 ƒ d  S(
   Nu   Foou   getnameu   baru%   something with interpolation (1 step)u   bar9u.   something with lots of interpolation (9 steps)u   bar10u/   something with lots of interpolation (10 steps)u   bar11(   u   get_interpolation_configu   assertEqualu   getu	   get_erroru   configparseru   InterpolationDepthError(   u   selfu   cfu   eq(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_interpolation?  s    	c             C   sa   |  j  ƒ  } |  j t j d d ƒ } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ d  S(   Nu   Interpolation Erroru   nameu	   reference(   u   get_interpolation_configu	   get_erroru   configparseru   InterpolationErroru   assertEqualu	   referenceu   sectionu   option(   u   selfu   cfu   e(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu    test_interpolation_missing_valueJ  s    c             C   s    |  j  d d d d d g ƒ d  S(   Nu   defaultu	   <default>u
   getdefaultu   |<default>|u   getnameu	   |section|u   keyu   |value|u   nameu   value(   u   defaultu	   <default>(   u
   getdefaultu   |<default>|(   u   getnameu	   |section|(   u   keyu   |value|(   u   nameu   value(   u   check_items_config(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   test_itemsR  s
    	c             C   s»  |  j  ƒ  } | j d ƒ | j d d d ƒ | j d d d d d d d d d	 d
 d g	 ƒ | j d d i d d 6d d 6d d 6ƒ | j d d d ƒ |  j | j d d d d ƒd ƒ |  j t | j d d ƒ |  j | j d d d d ƒd d d d d d d	 d
 d g	 ƒ |  j t | j d d ƒ |  j | j d d d d ƒi d d 6d d 6d d 6ƒ |  j t | j d d ƒ |  j | j d d d d ƒd ƒ |  j t | j d d d d ƒd  S(   Nu
   non-stringu   inti   u   listi    i   i   i   i   i   u   %(u   dictgn†ðù!	@u   piu   %(list)u   string_with_interpolationu   %(list)su   rawTF(
   u	   newconfigu   add_sectionu   setu   assertEqualu   getu   Trueu   assertRaisesu	   TypeErroru
   ValueErroru   False(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_set_nonstring_typesY  s&    .""N(	   u   __name__u
   __module__u   configparseru   ConfigParseru   config_classu   test_interpolationu    test_interpolation_missing_valueu
   test_itemsu   test_set_nonstring_types(   u
   __locals__(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   ConfigParserTestCase<  s
   
				u   ConfigParserTestCasec             B   s2   |  Ee  Z e j Z d  „  Z d „  Z d „  Z d S(   c             C   s–   |  j  ƒ  } |  j } | | j d d ƒ d ƒ | | j d d ƒ d ƒ | | j d d ƒ d ƒ | | j d d ƒ d	 ƒ | | j d d
 ƒ d ƒ d  S(   Nu   Foou   getnameu   %(__name__)su   baru*   something %(with1)s interpolation (1 step)u   bar9u3   something %(with9)s lots of interpolation (9 steps)u   bar10u5   something %(with10)s lots of interpolation (10 steps)u   bar11u5   something %(with11)s lots of interpolation (11 steps)(   u   get_interpolation_configu   assertEqualu   get(   u   selfu   cfu   eq(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_interpolationr  s    	c             C   s    |  j  d d d d d g ƒ d  S(   Nu   defaultu	   <default>u
   getdefaultu   |%(default)s|u   getnameu   |%(__name__)s|u   keyu
   |%(name)s|u   nameu   value(   u   defaultu	   <default>(   u
   getdefaultu   |%(default)s|(   u   getnameu   |%(__name__)s|(   u   keyu
   |%(name)s|(   u   nameu   value(   u   check_items_config(   u   self(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu
   test_items  s
    	c             C   sè   |  j  ƒ  } | j d ƒ | j d d d ƒ | j d d d d d d d d d	 d
 g ƒ | j d d i d d 6ƒ |  j | j d d ƒ d ƒ |  j | j d d ƒ d d d d d d d	 d
 g ƒ |  j | j d d ƒ i d d 6ƒ d  S(   Nu
   non-stringu   inti   u   listi    i   i   i   i   i   u   dictgn†ðù!	@u   pi(   u	   newconfigu   add_sectionu   setu   assertEqualu   get(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_set_nonstring_types†  s    +N(   u   __name__u
   __module__u   configparseru   RawConfigParseru   config_classu   test_interpolationu
   test_itemsu   test_set_nonstring_types(   u
   __locals__(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   RawConfigParserTestCaseo  s   
			u   RawConfigParserTestCasec             B   sD   |  Ee  Z e j Z d  „  Z d „  Z d „  Z d „  Z d „  Z	 d S(   c             C   sK   |  j  d ƒ } |  j | j d d ƒ d ƒ |  j | j d d ƒ d ƒ d  S(   NuW   [section]
option1=xxx
option2=%(option1)s/xxx
ok=%(option1)s/%%s
not_ok=%(option2)s/%%su   sectionu   oku   xxx/%su   not_oku
   xxx/xxx/%s(   u
   fromstringu   assertEqualu   get(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_safe_interpolation•  s    c             C   sŸ   |  j  d ƒ } |  j | j d d ƒ d ƒ |  j t | j d d d ƒ |  j t | j d d d ƒ |  j t | j d d d ƒ |  j | j d d ƒ d ƒ d  S(   Nu   [sect]
option1=foo
u   sectu   option1u   foou   %foou   foo%u   f%oo(   u
   fromstringu   assertEqualu   getu   assertRaisesu
   ValueErroru   set(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu#   test_set_malformatted_interpolationŸ  s    c             C   sÁ   |  j  d ƒ } |  j t | j d d d ƒ |  j t | j d d d ƒ |  j t | j d d t ƒ  ƒ |  j t | j d d d ƒ |  j t | j d d d ƒ |  j t | j d d t ƒ  ƒ d  S(   Nu   [sect]
option1=foo
u   sectu   option1i   g      ð?u   option2(   u
   fromstringu   assertRaisesu	   TypeErroru   setu   object(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_set_nonstring_types«  s    c             C   s&   |  j  ƒ  } |  j t | j d ƒ d  S(   Nu   default(   u	   newconfigu   assertRaisesu
   ValueErroru   add_section(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_add_section_default_1·  s    c             C   s&   |  j  ƒ  } |  j t | j d ƒ d  S(   Nu   DEFAULT(   u	   newconfigu   assertRaisesu
   ValueErroru   add_section(   u   selfu   cf(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_add_section_default_2»  s    N(
   u   __name__u
   __module__u   configparseru   SafeConfigParseru   config_classu   test_safe_interpolationu#   test_set_malformatted_interpolationu   test_set_nonstring_typesu   test_add_section_default_1u   test_add_section_default_2(   u
   __locals__(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   SafeConfigParserTestCase’  s   
		
			u   SafeConfigParserTestCasec             B   s#   |  Ee  Z d d  „ Z d „  Z d S(   c             C   s"   |  j  d | d t ƒ |  _ |  j S(   Nu   defaultsu	   dict_type(   u   config_classu
   SortedDictu   cf(   u   selfu   defaults(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu	   newconfigÀ  s    c             C   sC   |  j  d ƒ t j ƒ  } |  j j | ƒ |  j | j ƒ  d ƒ d  S(   Nu    [b]
o4=1
o3=2
o2=3
o1=4
[a]
k=v
u,   [a]
k = v

[b]
o1 = 4
o2 = 3
o3 = 2
o4 = 1

(   u
   fromstringu   iou   StringIOu   cfu   writeu   assertEqualsu   getvalue(   u   selfu   output(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   test_sortedÄ  s
    N(   u   __name__u
   __module__u   Noneu	   newconfigu   test_sorted(   u
   __locals__(    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   SortedTestCase¿  s   
u   SortedTestCasec               C   s   t  j t t t t ƒ d  S(   N(   u   supportu   run_unittestu   ConfigParserTestCaseu   RawConfigParserTestCaseu   SafeConfigParserTestCaseu   SortedTestCase(    (    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu	   test_main×  s
    u   __main__(   u   configparseru   iou   unittestu   collectionsu   testu   supportu   UserDictu
   SortedDictu   TestCaseu   TestCaseBaseu   ConfigParserTestCaseu   RawConfigParserTestCaseu   SafeConfigParserTestCaseu   SortedTestCaseu	   test_mainu   __name__(    (    (    u0   /mit/python/lib/python3.0/test/test_cfgparser.pyu   <module>   s   ÿ &3#-	