'Tests if listing processes works.'

def testProcessListing(self):

    def ProcessIter():
        return iter([client_test_lib.MockWindowsProcess()])
    with utils.Stubber(psutil, 'process_iter', ProcessIter):
        results = self.RunAction(standard.ListProcesses, None)
        self.assertEqual(len(results), 1)
        result = results[0]
        self.assertEqual(result.pid, 10)
        self.assertEqual(result.ppid, 1)
        self.assertEqual(result.name, 'cmd')
        self.assertEqual(result.exe, 'cmd.exe')
        self.assertEqual(result.cmdline, ['c:\\Windows\\cmd.exe', '/?'])
        self.assertEqual(result.ctime, 1217061982375000)
        self.assertEqual(result.username, 'test')
        self.assertEqual(result.status, 'running')
        self.assertEqual(result.cwd, u'X:\\RECEP\xc7\xd5ES')
        self.assertEqual(result.num_threads, 1)
        self.assertEqual(result.user_cpu_time, 1.0)
        self.assertEqual(result.system_cpu_time, 1.0)
        self.assertEqual(result.RSS_size, 100000)
        self.assertEqual(result.VMS_size, 150000)
        self.assertEqual(result.memory_percent, 10.0)
        self.assertEqual(result.nice, 10)
