diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-03-03 10:46:25 +0100 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-03-03 10:46:25 +0100 |
| commit | 0e79c6370c19e93330a74e843cc93844f841964a (patch) | |
| tree | dc29bf59b150df9a96305b430ad9c357a87e0064 | |
| parent | 63bb85326e6892129d4d43b337b9e360986b867c (diff) | |
| download | psutil-0e79c6370c19e93330a74e843cc93844f841964a.tar.gz | |
rename fun
| -rw-r--r-- | psutil/tests/__init__.py | 8 | ||||
| -rw-r--r-- | psutil/tests/test_system.py | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index a3a8f1ba..1db2369b 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -345,8 +345,10 @@ def reap_children(search_all=False): _subprocesses_started = set(alive) -def check_ip_address(addr, family): - """Attempts to check IP address's validity.""" +def check_net_address(addr, family): + """Check a net address validity. Supported families are IPv4, + IPv6 and MAC addresses. + """ if enum and PY3: assert isinstance(family, enum.IntEnum), family if family == AF_INET: @@ -393,7 +395,7 @@ def check_connection_ntuple(conn): ip, port = addr assert isinstance(port, int), port assert 0 <= port <= 65535, port - check_ip_address(ip, conn.family) + check_net_address(ip, conn.family) elif conn.family == AF_UNIX: assert isinstance(addr, (str, None)), addr else: diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index 5e116b99..4cbba7f8 100644 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -31,7 +31,7 @@ from psutil import WINDOWS from psutil._compat import long from psutil.tests import AF_INET6 from psutil.tests import APPVEYOR -from psutil.tests import check_ip_address +from psutil.tests import check_net_address from psutil.tests import DEVNULL from psutil.tests import enum from psutil.tests import get_test_subprocess @@ -568,7 +568,7 @@ class TestSystemAPIs(unittest.TestCase): # AddressValueError: Only hex digits permitted in # u'c6f3%lxcbr0' in u'fe80::c8e0:fff:fe54:c6f3%lxcbr0' if addr.family != AF_INET6: - check_ip_address(ip, addr.family) + check_net_address(ip, addr.family) # broadcast and ptp addresses are mutually exclusive if addr.broadcast: self.assertIsNone(addr.ptp) |
