a ze3@sddlZddlZddlZddlZddlZddlmZmZmZej dkrPe dedZ dej ej fZGdddejZd d Zed kredS) N)TESTFNunlink reap_childrenposixz pipes module only works on posix2ztr %s %sc@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdS) SimplePipeTestscCsttfD] }t|qdSN)rTESTFN2r)selffr C/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_pipes.pytearDowns zSimplePipeTests.tearDowncCstddur|dt}|ttj|t d}| dWdn1sZ0Ytt  }| | dWdn1s0YdS)Ntrtr is not availablewzhello world #1zHELLO WORLD #1) shutilwhichskipTestpipesTemplateappend s_command STDIN_STDOUTopenrwrite assertEqualread)r tr r r r testSimplePipe1s ( zSimplePipeTests.testSimplePipe1cCstddur|dttd}|dWdn1sB0Yt}|t dtj | tt tt  }| |dWdn1s0YdS)Nrrrhello world #2z < $IN > $OUTHELLO WORLD #2)rrrrrrrrrrFILEIN_FILEOUTcopyr rrr r rr r r testSimplePipe2s  (  zSimplePipeTests.testSimplePipe2cCstddur|dttd}|dWdn1sB0Yt}|t dtj |td}z| | dW| n | 0dS)Nrrrr z < $INrr!)rrrrrrrrrr FILEIN_STDOUTrrcloser$r r r testSimplePipe3*s  ( zSimplePipeTests.testSimplePipe3cCsd}ttd}||Wdn1s.0Yttd}|dWdn1sb0Yt}|tttt }|||Wdn1s0YdS)Nzempty pipeline test COPYr) rrrr rrr#rrr dr rr r r testEmptyPipeline17s ( (  z"SimplePipeTests.testEmptyPipeline1cCsxd}ttd}||Wdn1s.0Yt}|td}z|||W|n |0dS)Nzempty pipeline test READrr&)rrrrrrrr(r+r r r testEmptyPipeline2Cs ( z"SimplePipeTests.testEmptyPipeline2cCs~d}t}|td}||Wdn1s80Ytt }|||Wdn1sp0YdS)Nzempty pipeline test WRITEr)rrrrrrr)r r,rr r r r testEmptyPipeline3Os ( z"SimplePipeTests.testEmptyPipeline3cCs:t}|t|d|dtj|t|ddS)Nz