Your IP : 216.73.216.213
�
��f� c @ s� d Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z e j d � Z Gd d � d e j
� Z d d
� Z e
d k r� e j � n d S( uC Test InteractiveConsole and InteractiveInterpreter from code modulei N( u ExitStack( u mock( u supportu codec B sh | Ee Z 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( u TestInteractiveConsolec C s t j � | _ | j � d S( N( u codeu InteractiveConsoleu consoleu mock_sys( u self( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu setUp
s u TestInteractiveConsole.setUpc C s� t � } | j | j � | j t j d d d �� | _ | j t j d � � | _ | j t j d � � | _ t j d d t
j d t
j �} | j | � | _ t j
t j k r� | j j | j _
n d S(
u. Mock system environment for InteractiveConsoleu
code.inputu createu code.sys.stdoutu code.sys.stderru code.sysu wrapsu specNT( u ExitStacku
addCleanupu closeu
enter_contextu mocku patchu Trueu infuncu stdoutu stderru codeu sysu sysmodu
excepthooku __excepthook__( u selfu stacku prepatch( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu mock_sys s !u TestInteractiveConsole.mock_sysc C s9 t d � | j _ | j j � | j | j j d � d S( Nu Finishedu >>> ( u EOFErroru infuncu side_effectu consoleu interactu assertEqualu sysmodu ps1( u self( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu test_ps1 s
u TestInteractiveConsole.test_ps1c C s9 t d � | j _ | j j � | j | j j d � d S( Nu Finishedu ... ( u EOFErroru infuncu side_effectu consoleu interactu assertEqualu sysmodu ps2( u self( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu test_ps2$ s
u TestInteractiveConsole.test_ps2c C sr d d t d � g | j _ | j j � xC t | j j � D]# } d d j | d � k r; Pq; q; Wt d � � d S( Nu 'antioch'u u Finishedu antiochi u no console stdout(
u EOFErroru infuncu side_effectu consoleu interactu listu stdoutu method_callsu joinu AssertionError( u selfu call( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu test_console_stderr) s
u* TestInteractiveConsole.test_console_stderrc C si d t d � g | j _ | j j � x= | j j D]# } d d j | d � k r2 Pq2 q2 Wt d � � d S( Nu undefinedu Finishedu
NameError:u i u No syntax error from console( u EOFErroru infuncu side_effectu consoleu interactu stderru method_callsu joinu AssertionError( u selfu call( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu test_syntax_error2 s
u( TestInteractiveConsole.test_syntax_errorc C sQ d t d � g | j _ t j � } | | j _ | j j � | j | j
� d S( Nu raise ValueError('')u Finished( u EOFErroru infuncu side_effectu mocku Mocku sysmodu
excepthooku consoleu interactu
assertTrueu called( u selfu hook( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu test_sysexcepthook; s
u) TestInteractiveConsole.test_sysexcepthookN(
u __name__u
__module__u __qualname__u setUpu mock_sysu test_ps1u test_ps2u test_console_stderru test_syntax_erroru test_sysexcepthook( u
__locals__( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu TestInteractiveConsole s u TestInteractiveConsolec C s t j t � d S( N( u supportu run_unittestu TestInteractiveConsole( ( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu test_mainD s u test_mainu __main__( u __doc__u sysu unittestu
contextlibu ExitStacku mocku testu supportu
import_moduleu codeu TestCaseu TestInteractiveConsoleu test_mainu __name__u main( ( ( u: /opt/alt/python33/lib64/python3.3/test/test_code_module.pyu <module> s 9