#NEWLINE# def test_Token_change_privileges_enable( self ) : #NEWLINE# #INDENT# for ( disabled_priv , status ) in win32security . GetTokenInformation ( self . token0 , win32security . TokenPrivileges ) : #NEWLINE# #INDENT# if ( not ( status & win32security . SE_PRIVILEGE_ENABLED ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# ( was_enabled , was_disabled ) = _tokens . Token ( self . token0 ) . change_privileges ( enable_privs = [ disabled_priv ] ) #NEWLINE# for ( priv , status ) in win32security . GetTokenInformation ( self . token0 , win32security . TokenPrivileges ) : #NEWLINE# #INDENT# if ( priv == disabled_priv ) : #NEWLINE# #INDENT# assert ( status & win32security . SE_PRIVILEGE_ENABLED ) #NEWLINE# #UNINDENT# #UNINDENT# _tokens . Token ( self . token0 ) . change_privileges ( was_enabled , was_disabled )