
'![c           @   s}   d  d l  Z  d  d l Z d  d l m Z d  d l m Z m Z d  d l m Z e  j	 d d   Z d e f d     YZ d S(   iN(   t   stdlib(   t   CheckerTestCaset   Message(   t	   UNDEFINEDc         c   s7   |  j  | | |  z	 d  VWd  |  j | | |  Xd  S(   N(   t   register_transformt   unregister_transform(   t   managert   nodet	   transformt	   predicate(    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt   _add_transform   s    	t   TestStdlibCheckerc           B   sG   e  Z e j Z d    Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   c      
   C   sv   d  d  } t j } t j |  } t | t j |  7 t j d  } |  j    |  j j	 |  Wd  QXWd  QXd  S(   Nc         s   s   t  j   } |  | _ | Vd  S(   N(   t   astroidt
   AssignAttrt   parent(   R   t   contextt   new_node(    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt
   infer_func'   s    	s*   
            call_something()
            (
   t   NoneR   t   MANAGERt   inference_tipR
   t   Namet   extract_nodet   assertNoMessagest   checkert
   visit_call(   t   selfR   R   R   R   (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt,   test_deprecated_no_qname_on_unexpected_nodes   s    			c         C   sN   t  j d  } |  j t d d d | d t    |  j j |  Wd  QXd  S(   Ns?   
        import copy, os
        copy.copy(os.environ)
        t   msg_ids   shallow-copy-environR   t
   confidence(   R   R   t   assertAddsMessagesR   R   R   R   (   R   R   (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt   test_copy_environ5   s    	c         C   sN   t  j d  } |  j t d d d | d t    |  j j |  Wd  QXd  S(   Nsd   
        from copy import copy as test_cp
        import os as o
        test_cp(o.environ)
        R   s   shallow-copy-environR   R   (   R   R   R   R   R   R   R   (   R   R   (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt   test_copy_environ_hiddenA   s    	c         C   s6   t  j d  } |  j    |  j j |  Wd  QXd  S(   NsQ   
        import copy
        test_dict = {}
        copy.copy(test_dict)
        (   R   R   R   R   R   (   R   R   (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt   test_copy_dictO   s    	c         C   s6   t  j d  } |  j    |  j j |  Wd  QXd  S(   Nsp   
        import copy
        from missing_library import MissingObject
        copy.copy(MissingObject)
        (   R   R   R   R   R   (   R   R   (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt   test_copy_uninferableY   s    	c         C   s6   t  j d  } |  j    |  j j |  Wd  QXd  S(   NsC   
        import copy, os
        copy.deepcopy(os.environ)
        (   R   R   R   R   R   (   R   R   (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt   test_deepcopy_environd   s    	(   t   __name__t
   __module__R    t   StdlibCheckert   CHECKER_CLASSR   R   R    R!   R"   R#   (    (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyR      s   					
	(   t
   contextlibR   t   pylint.checkersR    t   pylint.testutilsR   R   t   pylint.interfacesR   t   contextmanagerR   R
   R   (    (    (    sB   lib/python2.7/site-packages/pylint/test/unittest_checker_stdlib.pyt   <module>	   s   