def test_user_modify_without_modifications_calls_ipa_correctly(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa( mocker, ['user', 'modify'], [('user-mod', [[ 'walterwhite', '--cn', 'walterwhite_first walterwhite_last', '--displayname', 'walterwhite_first walterwhite_last', '--email', 'walterwhite_email', '--first', 'walterwhite_first', '--last', 'walterwhite_last' ]])], 'walterwhite\n\n\n\n\n')
def test_user_create_does_not_pass_random_when_given_no_password(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa(mocker, [ 'user', 'create', 'barney', '--first', 'Barney', '--last', 'Rubble', '--no-password' ], [('user-add', [[ 'barney', '--first', 'Barney', '--gidnumber', 'clusterusers_gid', '--last', 'Rubble' ]])])
def test_user_create_passes_sshpubkey_when_given_key(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa(mocker, [ 'user', 'create', 'barney', '--first', 'Barney', '--last', 'Rubble', '--key', 'ssh-rsa somekey key_name' ], [('user-add', [[ 'barney', '--first', 'Barney', '--gidnumber', 'clusterusers_gid', '--last', 'Rubble', '--random', '--sshpubkey', 'ssh-rsa somekey key_name' ]])])
def test_user_create_includes_random_by_default(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa( mocker, ['user', 'create', 'barney', '--first', 'Barney', '--last', 'Rubble'], [('user-add', [[ 'barney', '--first', 'Barney', '--gidnumber', 'clusterusers_gid', '--last', 'Rubble', '--random' ]])], )
def test_user_create_without_uid_calls_ipa_correctly(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa( mocker, ['user', 'create'], [('user-add', [[ 'walterwhite', '--email', '*****@*****.**', '--first', 'Walter', '--gidnumber', 'clusterusers_gid', '--last', 'White', '--random' ]])], 'walterwhite\nWalter\nWhite\[email protected]\nNo\n', )
def test_user_modify_with_modifications_calls_ipa_correctly(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa( mocker, ['user', 'modify'], [('user-mod', [[ 'walterwhite', '--cn', 'Walt Jackson', '--displayname', 'Walt Jackson', '--email', '*****@*****.**', '--first', 'Walt', '--last', 'Jackson', ]])], 'walterwhite\nWalt\nJackson\[email protected]\nNo\n', )
def test_group_modify_without_modifications_calls_ipa_correctly(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa( mocker, ['group', 'modify'], [('group-mod', [['clustertonkers', '--desc', 'clustertonkers_desc']])], 'clustertonkers\n\n')
def test_group_modify_with_modifications_calls_ipa_correctly(mocker): test_utils.mock_ipa_find_output(mocker) test_utils.mock_options_passed_to_ipa( mocker, ['group', 'modify'], [('group-mod', [[ 'clustertonkers', '--desc', 'this is a more relevant description' ]])], 'clustertonkers\nthis is a more relevant description\n')