Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: third_party/psutil/test/_windows.py

Issue 8774018: Add psutil build step to fix pyauto media issues. Upgrade psutil to 0.4.0. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable Mac builds. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/psutil/test/_windows.py
diff --git a/third_party/psutil/test/_windows.py b/third_party/psutil/test/_windows.py
index ef5ff24c1f69ad84aa75d0d365419c92a83010ce..a1a66b0b08fdf839c1639aae7c8202c8a09dbcdc 100644
--- a/third_party/psutil/test/_windows.py
+++ b/third_party/psutil/test/_windows.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# $Id: _windows.py 1142 2011-10-05 18:45:49Z g.rodola $
+# $Id: _windows.py 1203 2011-10-24 19:10:36Z g.rodola $
#
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
@@ -16,10 +16,11 @@ import time
import warnings
import atexit
import sys
+import subprocess
import psutil
import _psutil_mswindows
-from test_psutil import reap_children, get_test_subprocess, wait_for_pid
+from test_psutil import reap_children, get_test_subprocess, wait_for_pid, PY3
try:
import wmi
except ImportError:
@@ -70,6 +71,18 @@ class WindowsSpecificTestCase(unittest.TestCase):
def test_signal(self):
p = psutil.Process(self.pid)
self.assertRaises(ValueError, p.send_signal, signal.SIGINT)
+
+ def test_nic_names(self):
+ p = subprocess.Popen(['ipconfig', '/all'], stdout=subprocess.PIPE)
+ out = p.communicate()[0]
+ if PY3:
+ out = str(out, sys.stdout.encoding)
+ nics = psutil.network_io_counters(pernic=True).keys()
+ for nic in nics:
+ if "pseudo-interface" in nic.replace(' ', '-').lower():
+ continue
+ if nic not in out:
+ self.fail("%r nic wasn't found in 'ipconfig /all' output" % nic)
if wmi is not None:

Powered by Google App Engine
This is Rietveld 408576698