ó
_y]c           @   s¦   d  d l  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 d l
 m Z e ƒ  Z e j j e d d	 ƒd
 e  j f d „  ƒ  Yƒ Z d S(   iÿÿÿÿN(   t   QtGui(   t
   load_qtest(   t   QtKernelClient(   t   JupyterWidgeti   (   t
   no_displayt   reasons   Doesn't work without a displayt   TestJupyterWidgetc           B   s8   e  Z e d  „  ƒ Z e d „  ƒ Z d „  Z d „  Z RS(   c         C   sJ   t  j j ƒ  |  _ |  j d k r6 t  j g  ƒ |  _ n  |  j j t ƒ d S(   s3    Create the application for the test case.
        N(   R    t   QApplicationt   instancet   _appt   Nonet   setQuitOnLastWindowClosedt   False(   t   cls(    (    sB   lib/python2.7/site-packages/qtconsole/tests/test_jupyter_widget.pyt
   setUpClass   s    c         C   s   t  j j ƒ  d S(   s    Exit the application.
        N(   R    R   t   quit(   R   (    (    sB   lib/python2.7/site-packages/qtconsole/tests/test_jupyter_widget.pyt   tearDownClass   s    c         C   s`   t  d d ƒ } |  j | j j d ƒ j ƒ  d ƒ d | _ |  j | j j d ƒ j ƒ  d ƒ d S(   s$    Test changing stylesheets.
        t   kindt   richi   s   #000000t   monokais   #ffffffN(   R   t   assertEqualt   _ansi_processort	   get_colort   namet   syntax_style(   t   selft   w(    (    sB   lib/python2.7/site-packages/qtconsole/tests/test_jupyter_widget.pyt   test_stylesheet_changed!   s    "	c         C   sÄ   t  d d ƒ } | j d ƒ | j d ƒ d | _ d | _ | j } | j ƒ  } t d d d d	 ƒ } | j | j	 | d
 t
 ƒ|  j | j ƒ  d ƒ |  j | j ƒ  d ƒ |  j | j ƒ  d ƒ d S(   s4    Test displaying output from other clients.
        R   R   s   Header
i   s   [other] t   defaultt   execution_countt   codes   a = 1 + 1
b = range(10)t   before_prompti   uI   Header

[other] In [1]: a = 1 + 1
           ...: b = range(10)

In [2]: uÛ  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Header</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">[other] In [</span><span style=" font-weight:600; color:#000080;">1</span><span style=" color:#000080;">]:</span> a = 1 + 1</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">Â Â Â Â Â Â Â Â Â Â Â ...:</span> b = range(10)</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">In [</span><span style=" font-weight:600; color:#000080;">2</span><span style=" color:#000080;">]:</span> </p></body></html>N(   R   t   _append_plain_textt   _show_interpreter_promptt   other_output_prefixR   t   _controlt   documentt   dictt   _append_customt   _insert_other_inputt   TrueR   t
   blockCountt   toPlainTextt   toHtml(   R   R   t   controlR$   t   msg(    (    sB   lib/python2.7/site-packages/qtconsole/tests/test_jupyter_widget.pyt   test_other_output-   s     					(   t   __name__t
   __module__t   classmethodR   R   R   R.   (    (    (    sB   lib/python2.7/site-packages/qtconsole/tests/test_jupyter_widget.pyR      s   		(   t   unittestt   pytestt   qtconsole.qtR    t   qtconsole.qt_loadersR   t   qtconsole.clientR   t   qtconsole.jupyter_widgetR   t    R   t   QTestt   markt   skipift   TestCaseR   (    (    (    sB   lib/python2.7/site-packages/qtconsole/tests/test_jupyter_widget.pyt   <module>   s   	