Skip to content

Commit 4817a16

Browse files
committed
Fix dhcpd IPython test
1 parent fa7d1d5 commit 4817a16

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/scapy/layers/dhcp.uts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,13 @@ assert DHCPRevOptions['static-routes'][0] == 33
125125

126126
assert dhcpd
127127
import IPython
128-
assert IPython.lib.pretty.pretty(dhcpd) == '<function scapy.ansmachine.dhcpd(self, pool=Net("192.168.1.128/25"), network=\'192.168.1.0/24\', gw=\'192.168.1.1\', nameserver=None, domain=None, renewal_time=60, lease_time=1800, **kwargs)>'
128+
129+
result = IPython.lib.pretty.pretty(dhcpd)
130+
result
131+
132+
if sys.version_info >= (3, 9):
133+
# Typing fully supported
134+
assert result == '<function scapy.ansmachine.dhcpd(self, pool: Union[scapy.base_classes.Net, List[str]] = Net("192.168.1.128/25"), network: str = \'192.168.1.0/24\', gw: str = \'192.168.1.1\', nameserver: Union[str, List[str]] = None, domain: Optional[str] = None, renewal_time: int = 60, lease_time: int = 1800, **kwargs)>'
135+
else:
136+
assert result == '<function scapy.ansmachine.dhcpd(self, pool=Net("192.168.1.128/25"), network=\'192.168.1.0/24\', gw=\'192.168.1.1\', nameserver=None, domain=None, renewal_time=60, lease_time=1800, **kwargs)>'
129137

0 commit comments

Comments
 (0)