Module Expr Str ImportFrom alias Import alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias alias Expr Call NameLoad Str ImportFrom alias ImportFrom alias alias ClassDef bases NameLoad body Expr Str Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign NameStore ListLoad Call AttributeLoad NameLoad attr TupleLoad Str Str Num Num Str Str Str Call AttributeLoad NameLoad attr TupleLoad Str Str Num Num Str Str Str Call AttributeLoad NameLoad attr TupleLoad Str Str Num Num Str Str Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Str Str Num Num Str Str Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Str Str Num ListLoad Assign NameStore ListLoad Call AttributeLoad NameLoad attr TupleLoad Str Str Num ListLoad Call AttributeLoad NameLoad attr TupleLoad Str Str Num ListLoad Str Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Num ListLoad Str Str Str Num FunctionDef arguments args NameParam defaults body Pass decorator_list Call NameLoad NameLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Dict Str Str Str Str Num Num Str Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Str Str TupleLoad Num Num Num body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Str Str Num Dict Str Str Str Str Num Num Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Num Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Dict Str Str Str Str Str Str Str Str Str Num ListLoad Str Str Str Num Dict Str Str Str Str Str Str Str Str Str Num ListLoad Str Str Str Num Dict Str Str Str Str Str Str Str Str Str Num ListLoad Str Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list Call NameLoad Str Call NameLoad keyword NameLoad Call NameLoad Str Call NameLoad keyword ListLoad Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Num decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Num decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword Dict FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad Call NameLoad Str Call NameLoad keyword TupleLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Str Str Num Num Str Str Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Num ListLoad Str Str Str Num With Call NameLoad Str Call NameLoad keyword NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list Call NameLoad Str Call NameLoad keyword ListLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Str Str Num Num Str Str Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Num ListLoad Str Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str Call NameLoad keyword ListLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list Call NameLoad Str Call NameLoad keyword NameLoad decorator_list Call NameLoad NameLoad NameLoad If CompareEq NameLoad Str body ImportFrom alias Expr Call NameLoad NameLoad keyword NameLoad
N/A N/A 
    :codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
 __future__ absolute_import N/A grp N/A pwd salttesting TestCase skipIf salttesting.helpers ensure_in_syspath salttesting.mock MagicMock patch NO_MOCK NO_MOCK_REASON N/A N/A ensure_in_syspath ../../ salt.modules mac_user salt.exceptions SaltInvocationError CommandExecutionError MacUserTestCase N/A TestCase N/A N/A 
    TestCase for the salt.modules.mac_user modules
     N/A N/A mac_user __context__ N/A N/A N/A mac_user __grains__ N/A N/A N/A mac_user __salt__ N/A N/A mock_pwall N/A N/A N/A pwd struct_passwd N/A _amavisd * 83 83 AMaViS Daemon /var/virusmails /usr/bin/false N/A N/A pwd struct_passwd N/A _appleevents * 55 55 AppleEvents Daemon /var/empty /usr/bin/false N/A N/A pwd struct_passwd N/A _appowner * 87 87 Application Owner /var/empty /usr/bin/false N/A mock_pwnam N/A N/A pwd struct_passwd N/A _TEST_GROUP * 83 83 AMaViS Daemon /var/virusmails /usr/bin/false N/A mock_getgrgid N/A N/A grp struct_group N/A _TEST_GROUP * 83 N/A N/A mock_getgrall N/A N/A N/A grp struct_group N/A accessibility * 90 N/A N/A N/A grp struct_group N/A admin * 80 N/A root admin N/A mock_info_ret N/A shell name gid groups home fullname uid /bin/bash test 4376 N/A TEST_GROUP /Users/foo TEST USER 4376 test_flush_dscl_cache N/A N/A self N/A N/A N/A N/A N/A skipIf True Waiting on some clarifications from bug report #10594 test_dscl N/A N/A self N/A N/A N/A 
        Tests the creation of a dscl node
         N/A mac_mock N/A MagicMock return_value N/A pid retcode stderr stdout 4948 0 N/A N/A N/A patch dict N/A mac_user __salt__ N/A cmd.run_all mac_mock N/A N/A N/A N/A patch dict N/A mac_user __grains__ N/A kernel osrelease osrelease_info Darwin 10.9.1 N/A 10 9 1 N/A N/A N/A N/A self assertEqual N/A N/A mac_user _dscl N/A username UniqueID 501 N/A pid retcode stderr stdout 4948 0 N/A test_first_avail_uid N/A N/A self N/A N/A N/A 
        Tests the availability of the next uid
         N/A N/A N/A self assertEqual N/A N/A mac_user _first_avail_uid 501 N/A N/A patch pwd.getpwall N/A MagicMock return_value mock_pwall test_add_user_exists N/A N/A self N/A N/A N/A 
        Tests if the user exists or not
         N/A N/A N/A self assertRaises CommandExecutionError N/A mac_user add test N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret test_add_whitespace N/A N/A self N/A N/A N/A 
        Tests if there is whitespace in the user name
         N/A N/A N/A self assertRaises SaltInvocationError N/A mac_user add foo bar N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_add_uid_int N/A N/A self N/A N/A N/A 
        Tests if the uid is an int
         N/A N/A N/A self assertRaises SaltInvocationError N/A mac_user add foo foo N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_add_gid_int N/A N/A self N/A N/A N/A 
        Tests if the gid is an int
         N/A N/A N/A self assertRaises SaltInvocationError N/A mac_user add foo 20 foo N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_delete_whitespace N/A N/A self N/A N/A N/A 
        Tests if there is whitespace in the user name
         N/A N/A N/A self assertRaises SaltInvocationError N/A mac_user delete foo bar N/A test_delete_user_exists N/A N/A self N/A N/A N/A 
        Tests if the user exists or not
         N/A N/A N/A self assertTrue N/A N/A mac_user delete foo N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_getent N/A N/A self N/A N/A N/A 
        Tests the list of information for all users
         N/A ret N/A N/A shell name gid groups home fullname uid /usr/bin/false _amavisd 83 N/A TEST_GROUP /var/virusmails AMaViS Daemon 83 N/A shell name gid groups home fullname uid /usr/bin/false _appleevents 55 N/A TEST_GROUP /var/empty AppleEvents Daemon 55 N/A shell name gid groups home fullname uid /usr/bin/false _appowner 87 N/A TEST_GROUP /var/empty Application Owner 87 N/A N/A N/A self assertEqual N/A N/A mac_user getent ret N/A N/A patch pwd.getpwall N/A MagicMock return_value mock_pwall N/A patch salt.modules.mac_user.list_groups N/A MagicMock return_value N/A TEST_GROUP test_chuid_int N/A N/A self N/A N/A N/A 
        Tests if the uid is an int
         N/A N/A N/A self assertRaises SaltInvocationError N/A mac_user chuid foo foo N/A test_chuid_user_exists N/A N/A self N/A N/A N/A 
        Tests if the user exists or not
         N/A N/A N/A self assertRaises CommandExecutionError N/A mac_user chuid foo 4376 N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_chuid_same_uid N/A N/A self N/A N/A N/A 
        Tests if the user's uid is the same as as the argument
         N/A N/A N/A self assertTrue N/A N/A mac_user chuid foo 4376 N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret test_chgid_int N/A N/A self N/A N/A N/A 
        Tests if the gid is an int
         N/A N/A N/A self assertRaises SaltInvocationError N/A mac_user chgid foo foo N/A test_chgid_user_exists N/A N/A self N/A N/A N/A 
        Tests if the user exists or not
         N/A N/A N/A self assertRaises CommandExecutionError N/A mac_user chgid foo 4376 N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_chgid_same_gid N/A N/A self N/A N/A N/A 
        Tests if the user's gid is the same as as the argument
         N/A N/A N/A self assertTrue N/A N/A mac_user chgid foo 4376 N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret test_chshell_user_exists N/A N/A self N/A N/A N/A 
        Tests if the user exists or not
         N/A N/A N/A self assertRaises CommandExecutionError N/A mac_user chshell foo /bin/bash N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_chshell_same_shell N/A N/A self N/A N/A N/A 
        Tests if the user's shell is the same as the argument
         N/A N/A N/A self assertTrue N/A N/A mac_user chshell foo /bin/bash N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret test_chhome_user_exists N/A N/A self N/A N/A N/A 
        Test if the user exists or not
         N/A N/A N/A self assertRaises CommandExecutionError N/A mac_user chhome foo /Users/foo N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_chhome_same_home N/A N/A self N/A N/A N/A 
        Tests if the user's home is the same as the argument
         N/A N/A N/A self assertTrue N/A N/A mac_user chhome foo /Users/foo N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret test_chfullname_user_exists N/A N/A self N/A N/A N/A 
        Tests if the user exists or not
         N/A N/A N/A self assertRaises CommandExecutionError N/A mac_user chfullname test TEST USER N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_chfullname_same_name N/A N/A self N/A N/A N/A 
        Tests if the user's full name is the same as the argument
         N/A N/A N/A self assertTrue N/A N/A mac_user chfullname test TEST USER N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret test_chgroups_user_exists N/A N/A self N/A N/A N/A 
        Tests if the user exists or not
         N/A N/A N/A self assertRaises CommandExecutionError N/A mac_user chgroups foo wheel,root N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value N/A test_chgroups_bad_groups N/A N/A self N/A N/A N/A 
        Test if there is white space in groups argument
         N/A N/A N/A self assertRaises SaltInvocationError N/A mac_user chgroups test bad group N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret test_chgroups_same_desired N/A N/A self N/A N/A N/A 
        Tests if the user's list of groups is the same as the arguments
         N/A mock_primary N/A MagicMock return_value wheel N/A N/A N/A patch dict N/A mac_user __salt__ N/A file.gid_to_group mock_primary N/A N/A N/A N/A self assertTrue N/A N/A mac_user chgroups test wheel,root N/A N/A patch salt.modules.mac_user.info N/A MagicMock return_value mock_info_ret N/A patch salt.modules.mac_user.list_groups N/A MagicMock return_value N/A wheel root test_info N/A N/A self N/A N/A N/A 
        Tests the return of user information
         N/A mock_pwnam N/A N/A pwd struct_passwd N/A test * 0 0 TEST USER /var/test /bin/bash N/A ret N/A shell name gid groups home fullname uid /bin/bash test 0 N/A _TEST_GROUP /var/test TEST USER 0 N/A N/A patch pwd.getpwnam N/A MagicMock return_value mock_pwnam N/A N/A N/A N/A self assertEqual N/A N/A mac_user info root ret N/A N/A patch salt.modules.mac_user.list_groups N/A MagicMock return_value N/A _TEST_GROUP test_format_info N/A N/A self N/A N/A N/A 
        Tests the formatting of returned user information
         N/A data N/A N/A pwd struct_passwd N/A _TEST_GROUP * 83 83 AMaViS Daemon /var/virusmails /usr/bin/false N/A ret N/A shell name gid groups home fullname uid /usr/bin/false _TEST_GROUP 83 N/A _TEST_GROUP /var/virusmails AMaViS Daemon 83 N/A N/A N/A self assertEqual N/A N/A mac_user _format_info data ret N/A N/A patch salt.modules.mac_user.list_groups N/A MagicMock return_value N/A _TEST_GROUP test_list_users N/A N/A self N/A N/A N/A 
        Tests the list of all users
         N/A ret N/A _amavisd _appleevents _appowner N/A N/A N/A self assertEqual N/A N/A mac_user list_users ret N/A N/A patch pwd.getpwall N/A MagicMock return_value mock_pwall N/A N/A skipIf NO_MOCK NO_MOCK_REASON N/A N/A __name__ __main__ N/A integration run_tests N/A N/A run_tests MacUserTestCase needs_daemon False