/usr/lib/python2.7/dist-packages/winrm/tests/test_protocol.py is in python-winrm 0.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | def test_open_shell_and_close_shell(protocol_fake):
shell_id = protocol_fake.open_shell()
assert shell_id == '11111111-1111-1111-1111-111111111113'
protocol_fake.close_shell(shell_id)
def test_run_command_with_arguments_and_cleanup_command(protocol_fake):
shell_id = protocol_fake.open_shell()
command_id = protocol_fake.run_command(shell_id, 'ipconfig', ['/all'])
assert command_id == '11111111-1111-1111-1111-111111111114'
protocol_fake.cleanup_command(shell_id, command_id)
protocol_fake.close_shell(shell_id)
def test_run_command_without_arguments_and_cleanup_command(protocol_fake):
shell_id = protocol_fake.open_shell()
command_id = protocol_fake.run_command(shell_id, 'hostname')
assert command_id == '11111111-1111-1111-1111-111111111114'
protocol_fake.cleanup_command(shell_id, command_id)
protocol_fake.close_shell(shell_id)
def test_get_command_output(protocol_fake):
shell_id = protocol_fake.open_shell()
command_id = protocol_fake.run_command(shell_id, 'ipconfig', ['/all'])
std_out, std_err, status_code = protocol_fake.get_command_output(shell_id, command_id)
assert status_code == 0
assert 'Windows IP Configuration' in std_out
assert len(std_err) == 0
protocol_fake.cleanup_command(shell_id, command_id)
protocol_fake.close_shell(shell_id)
|