Your IP : 18.116.19.29
�
e f � @ s� d Z d d l m Z d d l Z d d l m Z d d l m Z m Z m Z d d l
m Z Gd d � d e j � Z
Gd d
� d
e j � Z e d k r� e j d d
� n d S)z5Unittest for idlelib.WidgetRedirector
100% coverage
� )�requiresN)�Func)�Tk�Text�TclError)�WidgetRedirectorc @ sL e Z d Z e d d � � Z e d d � � Z d d � Z d d � Z d S)
�
InitCloseTestc C s, t d � t � | _ t | j � | _ d S)N�gui)r r �tkr �text)�cls� r
�G/opt/alt/python34/lib64/python3.4/idlelib/idle_test/test_widgetredir.py�
setUpClass s
zInitCloseTest.setUpClassc C s* | j j � | j j � | ` | ` d S)N)r �destroyr
)r r
r
r �
tearDownClass s
zInitCloseTest.tearDownClassc C sb t | j � } | j | j | j � | j | j | j j � | j t t | j � | j � d S)N)r r �assertEqual�widgetr
ZassertRaisesr �close)�self�redirr
r
r � test_init s
zInitCloseTest.test_initc C sY t | j � } | j d t � | j � | j | j i � | j t | j d � � d S)N�insertr ) r r �registerr r r �_operations�assertFalse�hasattr)r r r
r
r �
test_close! s
zInitCloseTest.test_closeN)�__name__�
__module__�__qualname__�classmethodr r r r r
r
r
r r s r c @ s� e Z d Z e d d � � Z e d d � � Z d d � Z d d � Z d d
� Z d d � Z d
d � Z
d d � Z d d � Z d d � Z
d d � Z d d � Z d d � Z d S)�WidgetRedirectorTestc C s, t d � t � | _ t | j � | _ d S)Nr )r r r
r r )r r
r
r r + s
zWidgetRedirectorTest.setUpClassc C s* | j j � | j j � | ` | ` d S)N)r r r
)r r
r
r r 1 s
z"WidgetRedirectorTest.tearDownClassc C sP t | j � | _ t � | _ | j j d | j � | _ | j j d d � d S)Nr �asdf)r r r r �funcr �orig_insertr )r r
r
r �setUp7 s zWidgetRedirectorTest.setUpc C s$ | j j d d � | j j � d S)Nz1.0�end)r �deleter r )r r
r
r �tearDown= s zWidgetRedirectorTest.tearDownc C s6 | j d t | j � � | j d t | j � � d S)NZ
RedirectorZOriginal)�assertIn�reprr r% )r r
r
r � test_reprA s zWidgetRedirectorTest.test_reprc C s~ | j | j j d d � d � | j | j j d � | j d | j j � | j d | j j � | j | j j | j � d S)Nz1.0r'