def test5_echo(self): sys.argv = ['--INPUT', 'split.ini_0', '--OUTPUT', 'echo.ini_0'] ExternalEcho.main() assert os.path.exists('echo.ini_0') sys.argv = ['--INPUT', 'split.ini_1', '--OUTPUT', 'echo.ini_1'] ExternalEcho.main() os.path.exists('echo.ini_1')
def test1_arg_priority(self): sys.stdout = StringIO() #should write default comment to logfile sys.argv = [] ExternalEcho.main() assert "default comment" in sys.stdout.getvalue() #should write infofile comment (because higher prio than default comment) to logfile sys.stdout.truncate(0) sys.argv = ["--LOG_STORAGE", "file", "--INPUT", 'input.ini'] ExternalEcho.main() assert "infofile comment" in sys.stdout.getvalue() #should write cmdline comment to logfile (because cmdline > infofile > default) sys.stdout.truncate(0) sys.argv = ["--LOG_STORAGE", "file", "--INPUT", 'input.ini', '--COMMENT', 'cmdline comment'] ExternalEcho.main() assert "cmdline comment" in sys.stdout.getvalue() sys.stdout = sys.__stdout__
def test2_extecho(self): sys.argv = ['--COMMENT', 'comment'] ExternalEcho.main()