コード例 #1
0
ファイル: test_moonpy.py プロジェクト: iLoveTux/moon.py
def _compare_output_script(content):
    t_file = tempfile.NamedTemporaryFile("r+")
    os.chmod(t_file.name, 0777)
    t_file.write(content)
    t_file.seek(0)
    fname = t_file.name
    python = pexpect.spawn("python {}".format(fname))
    moonpy = pexpect.spawn("python moonpy.py {}".format(fname))
    python.expect(pexpect.EOF)
    moonpy.expect(pexpect.EOF)
    return python.before, moonpy.before
コード例 #2
0
ファイル: test_moonpy.py プロジェクト: iLoveTux/moon.py
def _compare_output_dash_c(command):
    python = pexpect.spawn("python -c '{}'".format(command))
    moonpy = pexpect.spawn("python moonpy.py -c '{}'".format(command))
    python.expect(pexpect.EOF)
    moonpy.expect(pexpect.EOF)
    return python.before, moonpy.before