def test_valid_return_codes(): host = Api('localhost') assert host._valid_return_codes == (0, ) with host.valid_return_codes(0, 1): assert host._valid_return_codes == (0, 1) host.shell('whoami | grep -q asdfasdfasdf') assert host._valid_return_codes == (0, )
def test_valid_return_codes(): host = Api('localhost') assert host._valid_return_codes == (0, ) with host.valid_return_codes(0, 1): assert host._valid_return_codes == (0, 1) host.shell('whoami | grep -q asdfasdfasdf') assert host._valid_return_codes == (0, )
def test_environment(): api = Api('localhost', environment={'FOO': 'BAR'}) assert api.shell('echo $FOO').stdout() == 'BAR' api.environment['FOO'] = 'BAZ' assert api.shell('echo $FOO').stdout() == 'BAZ'
def test_environment(): api = Api('localhost', environment={'FOO': 'BAR'}) assert api.shell('echo $FOO').stdout() == 'BAR' api.environment['FOO'] = 'BAZ' assert api.shell('echo $FOO').stdout() == 'BAZ'