Groups every flat test_*.py under the module it exercises, matching the
existing tests/{profiler,sniffer,prober,collector,correlation,cli,web,
topology,swarm,bus,updater,api,docker,geoip,...} layout. New folders:
services/, fleet/, config/, logging/, db/ (+ db/mysql/), telemetry/,
mutator/, core/.
Path-dependent __file__ references bumped an extra .parent in three
files that moved one level deeper:
- tests/sniffer/test_sniffer_ja3.py (template path)
- tests/services/test_ssh_capture_emit.py (template path)
- tests/cli/test_mode_gating.py (REPO root)
- tests/web/test_env_lazy_jwt.py (repo var)
Also drops two SQLite runtime artifacts (test_decnet.db-{shm,wal}) that
were leaking into the repo from a previous test run.
Fixes two test_service_isolation cases that patched asyncio.sleep (no
longer on the profiler main-loop hot path — same pre-existing bug I
fixed earlier in test_attacker_worker.py) by patching asyncio.wait_for
and passing interval=0.
28 lines
651 B
Python
28 lines
651 B
Python
from decnet.ini_loader import load_ini_from_string
|
|
|
|
def test_load_ini_with_spaces_around_equals():
|
|
content = """
|
|
[general]
|
|
interface = eth0
|
|
|
|
[omega-decky]
|
|
services = http, ssh
|
|
"""
|
|
cfg = load_ini_from_string(content)
|
|
assert cfg.interface == "eth0"
|
|
assert len(cfg.deckies) == 1
|
|
assert cfg.deckies[0].name == "omega-decky"
|
|
assert cfg.deckies[0].services == ["http", "ssh"]
|
|
|
|
def test_load_ini_with_tabs_and_spaces():
|
|
content = """
|
|
[general]
|
|
interface = eth0
|
|
|
|
[omega-decky]
|
|
services = http, ssh
|
|
"""
|
|
cfg = load_ini_from_string(content)
|
|
assert cfg.interface == "eth0"
|
|
assert cfg.deckies[0].services == ["http", "ssh"]
|