ó
§‰]c           @   s}   d  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 f d	 „  ƒ  YZ
 d
 „  Z d S(   s   Tests for ScriptExporteriÿÿÿÿN(   t   v4i   (   t   ExportersTestsBasei   (   t   ScriptExportert   TestScriptExporterc           B   s8   e  Z d  Z e Z d „  Z d „  Z d „  Z d „  Z RS(   s   Tests for ScriptExporterc         C   s   |  j  ƒ  } d S(   s   Construct ScriptExporterN(   t   exporter_class(   t   selft   e(    (    sD   lib/python2.7/site-packages/nbconvert/exporters/tests/test_script.pyt   test_constructor   s    c         C   s=   |  j  ƒ  j |  j ƒ  ƒ \ } } t | ƒ d k s9 t ‚ d S(   s#   ScriptExporter can export somethingi    N(   R   t   from_filenamet   _get_notebookt   lent   AssertionError(   R   t   outputt	   resources(    (    sD   lib/python2.7/site-packages/nbconvert/exporters/tests/test_script.pyt   test_export   s    !c         C   s“   |  j  ƒ  } t j ƒ  } |  j  ƒ  j | ƒ \ } } |  j d | ƒ i d d 6d d 6d d 6| j _ |  j  ƒ  j | ƒ \ } } |  j d | ƒ d S(   s.   delegate to custom exporter from language_infos   # coding: utf-8t   pythont   names   text/x-pythont   mimetypet   nbconvert_exporterN(   R   R    t   new_notebookt   from_notebook_nodet   assertNotInt   metadatat   language_infot   assertIn(   R   t   exportert   pynbR   R   (    (    sD   lib/python2.7/site-packages/nbconvert/exporters/tests/test_script.pyt   test_export_python   s    c         C   s‚   t  j ƒ  } i d d 6d d 6d d 6| j _ |  j ƒ  } | j | ƒ | j d | k s_ t ‚ | j d j | j k s~ t ‚ d S(   s5   delegate config to custom exporter from language_infoR   R   s   text/x-pythonR   R   N(	   R    R   R   R   R   R   t
   _exportersR   t   config(   R   t   nbR   (    (    sD   lib/python2.7/site-packages/nbconvert/exporters/tests/test_script.pyt   test_export_config_transfer.   s    (	   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   (    (    (    sD   lib/python2.7/site-packages/nbconvert/exporters/tests/test_script.pyR      s   			c          C   s¦   t  j ƒ  }  i d d 6d d 6|  j _ t j j t j j t j	 j
 ƒ d ƒ } t j j d | ƒ z. t ƒ  j |  ƒ \ } } | d k s t ‚ Wd  t j j | ƒ Xd  S(   Nt   dummyR   s   text/x-dummyR   t   exporter_entrypointi    s   dummy-script-exported(   R    R   R   R   t   ost   patht   joint   dirnamet	   nbconvertt   testst   __file__t   syst   insertR   R   R   t   remove(   R   t   pR   t   _(    (    sD   lib/python2.7/site-packages/nbconvert/exporters/tests/test_script.pyt   test_script_exporter_entrypoint<   s    '(   R"   R%   R,   t   nbformatR    R)   t   baseR   t   scriptR   R   R1   (    (    (    sD   lib/python2.7/site-packages/nbconvert/exporters/tests/test_script.pyt   <module>   s   ,