mirror of https://github.com/secdev/scapy.git
don't use underscore as dummy var in tests #957
This commit is contained in:
parent
bdb53c0c34
commit
d2201f1b32
|
@ -134,7 +134,7 @@ from mock import patch
|
||||||
# can't remove the lo device (or its address without causing trouble) - use some pseudo dummy instead
|
# can't remove the lo device (or its address without causing trouble) - use some pseudo dummy instead
|
||||||
|
|
||||||
with patch('scapy.consts.LOOPBACK_NAME', 'scapy_lo_x'):
|
with patch('scapy.consts.LOOPBACK_NAME', 'scapy_lo_x'):
|
||||||
_ = read_routes()
|
routes = read_routes()
|
||||||
|
|
||||||
= catch looback device no address assigned
|
= catch looback device no address assigned
|
||||||
~ linux needs_root
|
~ linux needs_root
|
||||||
|
@ -148,7 +148,7 @@ exit_status = os.system("ip link set dev scapy_lo up")
|
||||||
assert(exit_status == 0)
|
assert(exit_status == 0)
|
||||||
|
|
||||||
with patch('scapy.consts.LOOPBACK_NAME', 'scapy_lo'):
|
with patch('scapy.consts.LOOPBACK_NAME', 'scapy_lo'):
|
||||||
_ = read_routes()
|
routes = read_routes()
|
||||||
|
|
||||||
exit_status = os.system("ip addr add dev scapy_lo 10.10.0.1/24")
|
exit_status = os.system("ip addr add dev scapy_lo 10.10.0.1/24")
|
||||||
assert(exit_status == 0)
|
assert(exit_status == 0)
|
||||||
|
@ -158,7 +158,7 @@ with patch('scapy.consts.LOOPBACK_NAME', 'scapy_lo'):
|
||||||
|
|
||||||
got_lo_device = False
|
got_lo_device = False
|
||||||
for route in routes:
|
for route in routes:
|
||||||
dst_int, msk_int, _, if_name, if_addr, _ = route
|
dst_int, msk_int, gw_str, if_name, if_addr, metric = route
|
||||||
if if_name == 'scapy_lo':
|
if if_name == 'scapy_lo':
|
||||||
got_lo_device = True
|
got_lo_device = True
|
||||||
assert(if_addr == '10.10.0.1')
|
assert(if_addr == '10.10.0.1')
|
||||||
|
|
Loading…
Reference in New Issue