ó
£„öUc           @   s†   d  d l  Z  d  d l Z d  d l Z d  d l m Z d  d l Z d  d l m Z d  d l m	 Z	 d e j
 f d „  ƒ  YZ d „  Z d S(   iÿÿÿÿN(   t   configparser(   t   base(   t   utilt!   TestExtrasRequireParsingScenariosc           B   s–   e  Z d  i d d 6i d d g d 6d d g d 6d 6f d	 i d
 d 6i d d g d 6d g d 6d 6f d i d d 6i  d 6f g Z d „  Z d „  Z RS(   t   simple_extrassÅ   
                [extras]
                first =
                    foo
                    bar==1.0
                second =
                    baz>=3.2
                    foo
                t   config_textt   foos   bar==1.0t   firsts   baz>=3.2t   secondt   expected_extra_requirest   with_markerssº   
                [extras]
                test =
                    foo:python_version=='2.6'
                    bar
                    baz<1.6 :python_version=='2.6'
                s   baz<1.6s   test:(python_version=='2.6')t   bart   testt	   no_extrassG   
            [metadata]
            long_description = foo
            c         C   st   i  } t  j ƒ  } t j t j | ƒ ƒ } | j t j | ƒ ƒ x- | j	 ƒ  D] } t
 | j | ƒ ƒ | | <qM W| S(   N(   R    t   SafeConfigParsert   textwrapt   dedentt   sixt   ut   readfpt   iot   StringIOt   sectionst   dictt   items(   t   selft   init   configt   parsert   section(    (    s7   /usr/lib/python2.7/dist-packages/pbr/tests/test_util.pyt   config_from_ini>   s    c         C   s<   |  j  |  j ƒ } t j | ƒ } |  j |  j | d ƒ d  S(   Nt   extras_require(   R   R   R   t   setup_cfg_to_setup_kwargst   assertEqualR	   (   R   R   t   kwargs(    (    s7   /usr/lib/python2.7/dist-packages/pbr/tests/test_util.pyt   test_extras_parsingG   s    (   t   __name__t
   __module__t	   scenariosR   R#   (    (    (    s7   /usr/lib/python2.7/dist-packages/pbr/tests/test_util.pyR      s   			c         C   s   t  j |  | | ƒ S(   N(   t   testscenariost   load_tests_apply_scenarios(   t   loadert   in_testst   pattern(    (    s7   /usr/lib/python2.7/dist-packages/pbr/tests/test_util.pyt
   load_testsO   s    (   R   R   R   t	   six.movesR    R'   t	   pbr.testsR   t   pbrR   t   BaseTestCaseR   R,   (    (    (    s7   /usr/lib/python2.7/dist-packages/pbr/tests/test_util.pyt   <module>   s   5