ķ
§]c           @   s@   d  Z  d d l m Z d d l m Z d e f d     YZ d S(   s5   
Module with tests for the clearoutput preprocessor.
i   (   t   PreprocessorTestsBasei   (   t   ClearOutputPreprocessort   TestClearOutputc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s*   Contains test functions for clearoutput.pyc         C   sS   t  t |   j   } d | j d k r; i  | j d _ n  d | j d j d <| S(   Nt   metadatai    t
   test_valuet
   test_field(   t   superR   t   build_notebookt   cellsR   (   t   selft   notebook(    (    sM   lib/python2.7/site-packages/nbconvert/preprocessors/tests/test_clearoutput.pyR      s
    c         C   s   t    } t | _ | S(   s"   Make an instance of a preprocessor(   R   t   Truet   enabled(   R	   t   preprocessor(    (    sM   lib/python2.7/site-packages/nbconvert/preprocessors/tests/test_clearoutput.pyt   build_preprocessor   s    		c         C   s   |  j    d S(   s-   Can a ClearOutputPreprocessor be constructed?N(   R   (   R	   (    (    sM   lib/python2.7/site-packages/nbconvert/preprocessors/tests/test_clearoutput.pyt   test_constructor   s    c         C   s  xt  t g D]ø } |  j   } |  j   } |  j   } | rP | j j d  n  | | |  \ } } | j d j g  k s t	  | j d j
 d k s t	  d | j d k r x- | j D]" } | | j d j k sē t	  qē W| sd | j d j k st	  q q Wd S(   s.   Test the output of the ClearOutputPreprocessorR   i    R   N(   t   FalseR   R   t   build_resourcesR   t   remove_metadata_fieldst   addR   t   outputst   AssertionErrort   execution_countt   NoneR   (   R	   t   remove_test_fieldt   nbt   resR   t   field(    (    sM   lib/python2.7/site-packages/nbconvert/preprocessors/tests/test_clearoutput.pyt   test_output!   s     (   t   __name__t
   __module__t   __doc__R   R   R   R   (    (    (    sM   lib/python2.7/site-packages/nbconvert/preprocessors/tests/test_clearoutput.pyR      s
   			N(   R   t   baseR    t   clearoutputR   R   (    (    (    sM   lib/python2.7/site-packages/nbconvert/preprocessors/tests/test_clearoutput.pyt   <module>   s   