def test_no_execute(self): runner = Runner( ['test.py', 'nohelpnoexecute'], commands=[ 'tests.watson.console.support.SampleNoHelpNoExecuteCommand' ]) runner.execute()
def test_execute_command_usage(self): runner = Runner(commands=[ 'tests.watson.console.support.SampleStringCommand', SampleNonStringCommand ]) with raises(SystemExit): runner.execute(['test.py', 'nonstring', 'execute', '-h']) # will print to screen in tests
def test_execute_command_usage(self): runner = Runner(['test.py', 'nonstring', '-h'], commands=[ 'tests.watson.console.support.SampleStringCommand', SampleNonStringCommand ]) output = runner.execute() # will print to screen in tests assert not output
def test_execute_command_with_args_options(self): runner = Runner(['test.py', 'runargsoptions', 'test', '-f', 'filename.txt'], commands=[ 'tests.watson.console.support.SampleArgumentsCommand', 'tests.watson.console.support.SampleArgumentsWithOptionsCommand' ]) output = runner.execute() # will print to screen in tests assert output
def test_execute_command_with_args(self): runner = Runner( ['test.py', 'runargs', 'test', 'test2'], commands=['tests.watson.console.support.SampleArgumentsCommand']) output = runner.execute() # will print to screen in tests assert output
def test_execute_command_with_options(self): runner = Runner( ['test.py', 'runoptions', '-f', 'test'], commands=['tests.watson.console.support.SampleOptionsCommand']) output = runner.execute() # will print to screen in tests assert output
def test_execute_command_with_args(self): runner = Runner(['test.py', 'runargs', 'test', 'test2'], commands=[ 'tests.watson.console.support.SampleArgumentsCommand' ]) output = runner.execute() # will print to screen in tests assert output
def test_execute_command_with_options(self): runner = Runner(['test.py', 'runoptions', '-f', 'test'], commands=[ 'tests.watson.console.support.SampleOptionsCommand' ]) output = runner.execute() # will print to screen in tests assert output
def test_no_execute(self): with raises(TypeError): runner = Runner(['test.py', 'nohelpnoexecute'], commands=[ 'tests.watson.console.support.SampleNoHelpNoExecuteCommand' ]) runner.execute()
def test_execute_command_with_options_invalid(self): runner = Runner(commands=[ 'tests.watson.console.support.SampleOptionsCommand' ]) with raises(SystemExit): runner.execute(['test.py', 'runoptions', 'execute', '-d']) # will print to screen in tests
def test_execute_command_usage_with_args(self): runner = Runner(commands=[ 'tests.watson.console.support.SampleArgumentsCommand' ]) with raises(SystemExit): runner.execute(['test.py', 'runargs', 'execute', '-h']) # will print to screen in tests
def test_no_execute(self): with raises(SystemExit): runner = Runner(commands=[ 'tests.watson.console.support.SampleNoHelpNoExecuteCommand' ]) runner.execute(['test.py', 'nohelpnoexecute', 'execute'])