def test5_echo(self): sys.argv = ['--INPUT', 'split.ini_0', '--OUTPUT', 'echo.ini_0'] EchoWrapped.main() assert os.path.exists('echo.ini_0') sys.argv = ['--INPUT', 'split.ini_1', '--OUTPUT', 'echo.ini_1'] EchoWrapped.main() os.path.exists('echo.ini_1')
def test1_arg_priority(self): sys.stdout = StringIO() #should write default comment to logfile sys.argv = [] EchoWrapped.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'] EchoWrapped.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'] EchoWrapped.main() assert "cmdline comment" in sys.stdout.getvalue() sys.stdout = sys.__stdout__
def test2_extecho(self): sys.argv = ['--COMMENT', 'comment'] EchoWrapped.main()