ó
X¾÷Xc           @   s=   d  d l  m Z d  d l m Z d e j f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   content(   t   baset   TestCommandsc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   sn   |  j  d ƒ \ } } } |  j d t j | ƒ ƒ |  j d t j | ƒ ƒ |  j d | ƒ |  j d | ƒ d S(   sÃ   Test custom build_py command.

        Test that a custom subclass of the build_py command runs when listed in
        the commands [global] option, rather than the normal build command.
        t   build_pyt   stdoutt   stderrs    Running custom build_py command.i    N(   t	   run_setupt	   addDetailR    t   text_contentt   assertInt   assertEqual(   t   selfR   R   t   return_code(    (    s4   /tmp/pip-build-h1VYrz/pbr/pbr/tests/test_commands.pyt   test_custom_build_py_command/   s
    c         C   sn   |  j  d ƒ \ } } } |  j d t j | ƒ ƒ |  j d t j | ƒ ƒ |  j d | ƒ |  j d | ƒ d S(   s    Test custom deb_version command.t   deb_versionR   R   s   Extracting deb versioni    N(   R   R   R    R   R	   R
   (   R   R   R   R   (    (    s4   /tmp/pip-build-h1VYrz/pbr/pbr/tests/test_commands.pyt"   test_custom_deb_version_py_command<   s
    c         C   sn   |  j  d ƒ \ } } } |  j d t j | ƒ ƒ |  j d t j | ƒ ƒ |  j d | ƒ |  j d | ƒ d S(   s    Test custom rpm_version command.t   rpm_versionR   R   s   Extracting rpm versioni    N(   R   R   R    R   R	   R
   (   R   R   R   R   (    (    s4   /tmp/pip-build-h1VYrz/pbr/pbr/tests/test_commands.pyt"   test_custom_rpm_version_py_commandD   s
    c         C   s‰   |  j  d ƒ \ } } } |  j d | ƒ g  } x7 | j d ƒ D]& } | j | j d ƒ d j ƒ  ƒ q> Wt | ƒ } |  j | | ƒ d S(   s?   Test that freeze output is sorted in a case-insensitive manner.t   freezei    s   
s   ==N(   t   run_pbrR
   t   splitt   appendt   lowert   sorted(   R   R   R   R   t   pkgst   lt	   pkgs_sort(    (    s4   /tmp/pip-build-h1VYrz/pbr/pbr/tests/test_commands.pyt   test_freeze_commandL   s    $(   t   __name__t
   __module__R   R   R   R   (    (    (    s4   /tmp/pip-build-h1VYrz/pbr/pbr/tests/test_commands.pyR   .   s   			N(   t	   testtoolsR    t	   pbr.testsR   t   BaseTestCaseR   (    (    (    s4   /tmp/pip-build-h1VYrz/pbr/pbr/tests/test_commands.pyt   <module>)   s   