a 5êdgã@sdddlZddlmZddlZddlZejZdevr>dedZGdd„dejƒZe dkr`e  ¡dS)éN)Úsupportú ú"c@s<eZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd S)Ú PopenTestcCsbd}|t|f}t |¡}| ¡}Wdƒn1s80Yt|ƒdd…}| ||¡dS)Nz&%s -c "import sys; print(sys.argv)" %sé)ÚpythonÚosÚpopenÚreadÚevalÚ assertEqual)ÚselfZcmdlineZexpectedÚcmdÚpÚdataZgot©rú+/usr/local/lib/python3.9/test/test_popen.pyÚ_do_test_commandlines   &zPopenTest._do_test_commandlinecCsJ| ttj¡| dddg¡| dgd¢¡| dgd¢¡t ¡dS)Nzfoo barÚfooÚbarz foo "spam and eggs" "silly walk")rz spam and eggsz silly walkzfoo "a \"quoted\" arg" bar)rza "quoted" argr)Z assertRaisesÚ TypeErrorrr rrÚ reap_children©r rrrÚ test_popensþþþzPopenTest.test_popencCsR| t d¡ ¡d¡t d¡ ¡}tjdkr<| |d¡n| t |¡d¡dS)Núexit 0zexit 42Únté*)r rr ÚcloseÚnameÚwaitstatus_to_exitcode)r ÚstatusrrrÚtest_return_code-s  zPopenTest.test_return_codecCs>t d¡ }| | ¡d¡Wdƒn1s00YdS©Nz echo hellozhello )rr r r ©r ÚfrrrÚtest_contextmanager5s zPopenTest.test_contextmanagercCs@t d¡"}| t|ƒdg¡Wdƒn1s20YdSr")rr r Úlistr#rrrÚtest_iterating9s zPopenTest.test_iteratingcCs4tjddddWdƒn1s&0YdS)NrÚwéÿÿÿÿ)rÚmodeÚ buffering)rr rrrrÚ test_keywords=szPopenTest.test_keywordsN) Ú__name__Ú __module__Ú __qualname__rrr!r%r'r,rrrrrs rÚ__main__) ZunittestÚtestrrÚsysÚ executablerZTestCaserr-ÚmainrrrrÚs  .