#NEWLINE# @ unittest . skipIf ( ( wmi is None ) , 'wmi module is not installed' ) #NEWLINE# def test_process_username( self ) : #NEWLINE# #INDENT# w = wmi . WMI ( ) . Win32_Process ( ProcessId = self . pid ) [ 0 ] #NEWLINE# p = psutil . Process ( self . pid ) #NEWLINE# ( domain , _ , username ) = w . GetOwner ( ) #NEWLINE# username = ( '%s\\%s' % ( domain , username ) ) #NEWLINE# self . assertEqual ( p . username ( ) , self )