From f696afa45dc33c57ef44fc8b1d7bcaf4089eda24 Mon Sep 17 00:00:00 2001 From: _Frky <3105926+Frky@users.noreply.github.com> Date: Mon, 30 May 2022 15:28:05 +0200 Subject: [PATCH] Run Black --- test/src/core.py | 4 ++-- test/src/tests/tcp.py | 15 +++++---------- test/src/tests/udp.py | 13 +++---------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/test/src/core.py b/test/src/core.py index 450743f..35681e6 100644 --- a/test/src/core.py +++ b/test/src/core.py @@ -47,10 +47,10 @@ def test(f): def w(m): try: # check that masscanned is still running - assert(m.poll() is None), "masscanned not running" + assert m.poll() is None, "masscanned not running" f() # check that masscanned is still running - assert(m.poll() is None), "masscanned terminated unexpectedly" + assert m.poll() is None, "masscanned terminated unexpectedly" LOG.info("{}{}".format(fname, OK)) except AssertionError as e: LOG.error("{}{}: {}".format(fname, KO, e)) diff --git a/test/src/tests/tcp.py b/test/src/tests/tcp.py index 3c2ca5e..f42e4fa 100644 --- a/test/src/tests/tcp.py +++ b/test/src/tests/tcp.py @@ -24,28 +24,23 @@ from scapy.volatile import RandInt from ..conf import IPV4_ADDR, IPV6_ADDR, MAC_ADDR from ..core import test, check_ip_checksum, check_ipv6_checksum + @test def test_ipv4_tcp_empty(): for p in [0, 80, 443]: - req = ( - Ether(dst=MAC_ADDR) - / IP(dst=IPV4_ADDR, proto=6) # UDP - / Raw() - ) + req = Ether(dst=MAC_ADDR) / IP(dst=IPV4_ADDR, proto=6) / Raw() # UDP repl = srp1(req, timeout=1) assert repl is None, "expecting no answer, got one" + @test def test_ipv6_tcp_empty(): for p in [0, 80, 443]: - req = ( - Ether(dst=MAC_ADDR) - / IPv6(dst=IPV6_ADDR, nh=6) # UDP - / Raw() - ) + req = Ether(dst=MAC_ADDR) / IPv6(dst=IPV6_ADDR, nh=6) / Raw() # UDP repl = srp1(req, timeout=1) assert repl is None, "expecting no answer, got one" + @test def test_tcp_syn(): ##### SYN-ACK ##### diff --git a/test/src/tests/udp.py b/test/src/tests/udp.py index 73421a4..db840cb 100644 --- a/test/src/tests/udp.py +++ b/test/src/tests/udp.py @@ -28,21 +28,14 @@ from ..core import test, check_ip_checksum, check_ipv6_checksum @test def test_ipv4_udp_empty(): for p in [0, 53, 1000]: - req = ( - Ether(dst=MAC_ADDR) - / IP(dst=IPV4_ADDR, proto=17) # UDP - / Raw() - ) + req = Ether(dst=MAC_ADDR) / IP(dst=IPV4_ADDR, proto=17) / Raw() # UDP repl = srp1(req, timeout=1) assert repl is None, "expecting no answer, got one" + @test def test_ipv6_udp_empty(): for p in [0, 53, 1000]: - req = ( - Ether(dst=MAC_ADDR) - / IPv6(dst=IPV6_ADDR, nh=17) # UDP - / Raw() - ) + req = Ether(dst=MAC_ADDR) / IPv6(dst=IPV6_ADDR, nh=17) / Raw() # UDP repl = srp1(req, timeout=1) assert repl is None, "expecting no answer, got one"