ó
'![c           @   sı   d  Z  d d l Z d d l j Z d d l Z d d l m Z d d l m	 Z	 d d l
 m Z d d l m Z d e f d     YZ d	 e j f d
     YZ e d k rµ e j   n  d S(   sD   Tests for the pylint checker in :mod:`pylint.extensions.emptystring
i˙˙˙˙N(   t   checkers(   t   CompareToZeroChecker(   t   PyLinter(   t   BaseReportert   CompareToZeroTestReporterc           B   s   e  Z d    Z d   Z RS(   c         C   s   |  j  j |  d  S(   N(   t   messagest   append(   t   selft   msg(    (    sH   lib/python2.7/site-packages/pylint/test/extensions/test_comparetozero.pyt   handle_message   s    c         C   s   g  |  _  d  S(   N(   R   (   R   t   modulet   filepath(    (    sH   lib/python2.7/site-packages/pylint/test/extensions/test_comparetozero.pyt   on_set_current_module   s    (   t   __name__t
   __module__R	   R   (    (    (    sH   lib/python2.7/site-packages/pylint/test/extensions/test_comparetozero.pyR      s   	t   CompareToZeroUsedTCc           B   s    e  Z e d     Z d   Z RS(   c         C   s\   t    |  _ |  j j t    t j |  j  |  j j t |  j   |  j j d  d  S(   Nt   I(	   R   t   _lintert   set_reporterR   R    t
   initializet   register_checkerR   t   disable(   t   cls(    (    sH   lib/python2.7/site-packages/pylint/test/extensions/test_comparetozero.pyt
   setUpClass!   s
    c         C   s$  t  j t  j t  j t   d d  } |  j j | g  |  j j j } |  j	 t
 |  d  x4 | D], } |  j	 | j d  |  j	 | j d  qf W|  j	 | d j d  |  j	 | d j d  |  j	 | d	 j d
  |  j	 | d j d  |  j	 | d j d  |  j	 | d j d  d  S(   Nt   datas   compare_to_zero.pyi   s   compare-to-zeros   Avoid comparisons to zeroi    i   i	   i   i   i   i   i   i   i   i   (   t   ospt   joint   dirnamet   abspatht   __file__R   t   checkt   reporterR   t   assertEqualt   lent   symbolR   t   line(   R   t	   elif_testt   msgsR   (    (    sH   lib/python2.7/site-packages/pylint/test/extensions/test_comparetozero.pyt   test_comparetozero_message)   s    	(   R   R   t   classmethodR   R&   (    (    (    sH   lib/python2.7/site-packages/pylint/test/extensions/test_comparetozero.pyR      s   t   __main__(   t   __doc__t   ost   os.patht   pathR   t   unittestt   pylintR    t   pylint.extensions.comparetozeroR   t   pylint.lintR   t   pylint.reportersR   R   t   TestCaseR   R   t   main(    (    (    sH   lib/python2.7/site-packages/pylint/test/extensions/test_comparetozero.pyt   <module>
   s   	