ó {G_Tc@sdZddlZddlmZddlZddlZejZdejfd„ƒYZ d„Z e dkr{e ƒndS(sQBasic tests for os.popen() Particularly useful for platforms that fake popen. iÿÿÿÿN(t test_supportt PopenTestcBs#eZd„Zd„Zd„ZRS(cCsMdt|f}tj|ƒjƒd}t|ƒd}|j||ƒdS(Ns$%s -c "import sys;print sys.argv" %ss i(tpythontostpopentreadtevalt assertEqual(tselftcmdlinetexpectedtcmdtdatatgot((s+/usr/local/lib/python2.7/test/test_popen.pyt_do_test_commandlinescCsi|jttjƒ|jdddgƒ|jddddgƒ|jddddgƒtjƒdS( Nsfoo bartfootbars foo "spam and eggs" "silly walk"s spam and eggss silly walksfoo "a \"quoted\" arg" barsa "quoted" arg(t assertRaisest TypeErrorRRRRt reap_children(R((s+/usr/local/lib/python2.7/test/test_popen.pyt test_popens cCss|jtjdƒjƒdƒtjdkrP|jtjdƒjƒdƒn|jtjdƒjƒdƒdS(Nsexit 0tntsexit 42i*ii*(RRRtclosetNonetname(R((s+/usr/local/lib/python2.7/test/test_popen.pyttest_return_code(s"(t__name__t __module__RRR(((s+/usr/local/lib/python2.7/test/test_popen.pyRs  cCstjtƒdS(N(Rt run_unittestR(((s+/usr/local/lib/python2.7/test/test_popen.pyt test_main/st__main__( t__doc__tunittestttestRRtsyst executableRtTestCaseRRR(((s+/usr/local/lib/python2.7/test/test_popen.pyts