示例#1
0
def test_userdel_raises_command_error(buffer_connection, command_output_and_expected_result):
    command_output, expected_result = command_output_and_expected_result
    buffer_connection.remote_inject_response([command_output])
    userdel_cmd = Userdel(connection=buffer_connection.moler_connection, options='-p', user='******', prompt=None,
                          newline_chars=None)
    with pytest.raises(CommandFailure):
        userdel_cmd()
示例#2
0
def test_userdel_returns_proper_command_string_with_option(buffer_connection):
    userdel_cmd = Userdel(connection=buffer_connection.moler_connection,
                          user='******',
                          options='-R CHROOT_DIR',
                          prompt=None,
                          new_line_chars=None)
    assert "userdel -R CHROOT_DIR xyz" == userdel_cmd.command_string
示例#3
0
def test_userdel_raises_command_error_with_help(buffer_connection):
    command_output, expected_result = command_output_and_expected_result_help()
    buffer_connection.remote_inject_response([command_output])
    userdel_cmd = Userdel(connection=buffer_connection.moler_connection,
                          options='-f',
                          prompt=None,
                          new_line_chars=None)
    with pytest.raises(CommandFailure):
        userdel_cmd()
示例#4
0
def test_userdel_returns_proper_command_string(buffer_connection):
    userdel_cmd = Userdel(connection=buffer_connection.moler_connection, user='******', prompt=None, newline_chars=None)
    assert "userdel xyz" == userdel_cmd.command_string