mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
Tests: clean Python code, add linting to CI
This commit is contained in:
parent
f397198d75
commit
70eae9bc0c
4 changed files with 636 additions and 243 deletions
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
|
@ -72,7 +72,16 @@ jobs:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo pip install -r test/requirements.txt
|
run: sudo pip install -U -r test/requirements.txt
|
||||||
|
|
||||||
|
- name: Install linting tools
|
||||||
|
run: sudo pip install -U flake8 black
|
||||||
|
|
||||||
|
- name: Run black
|
||||||
|
run: black -t py36 --check test/test_masscanned.py test/src/
|
||||||
|
|
||||||
|
- name: Run flake8
|
||||||
|
run: flake8 --ignore=E266,E501,W503 test/test_masscanned.py test/src/all.py
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: sudo python test/test_masscanned.py
|
run: sudo python test/test_masscanned.py
|
||||||
|
|
858
test/src/all.py
858
test/src/all.py
File diff suppressed because it is too large
Load diff
|
@ -28,7 +28,8 @@ from scapy.interfaces import resolve_iface
|
||||||
from scapy.layers.tuntap import TunTapInterface
|
from scapy.layers.tuntap import TunTapInterface
|
||||||
|
|
||||||
from src.all import test_all
|
from src.all import test_all
|
||||||
from src.conf import *
|
from src.conf import IPV4_ADDR, IPV6_ADDR, MAC_ADDR, OUTDIR
|
||||||
|
|
||||||
|
|
||||||
def setup_logs():
|
def setup_logs():
|
||||||
ch = logging.StreamHandler()
|
ch = logging.StreamHandler()
|
||||||
|
@ -39,6 +40,7 @@ def setup_logs():
|
||||||
log.addHandler(ch)
|
log.addHandler(ch)
|
||||||
return log
|
return log
|
||||||
|
|
||||||
|
|
||||||
LOG = setup_logs()
|
LOG = setup_logs()
|
||||||
IFACE = "tap0"
|
IFACE = "tap0"
|
||||||
conf.verb = 0
|
conf.verb = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue