def test3_cp(self): sys.argv = ["--FILE", "testfile"] if _platform == "linux": CpApp.main() os.chmod("testfile", 000) self.assertRaises(SystemExit, CpApp.main) os.chmod("testfile", 644)
def echo(infile, outfile): sys.argv = ["--INPUT", infile, "--OUTPUT", outfile] CpApp.main()
def test3_cp(self): sys.argv = ['--INPUT', 'forcp.ini', '--OUTPUT', 'cp.ini'] CpApp.main() assert os.path.exists('cp.ini') assert 'COPY' in open('cp.ini').read()
def echo(infile, outfile): sys.argv = ['--INPUT', infile, '--OUTPUT', outfile] CpApp.main()