Initial commit: Werkzeuge-Sammlung
Enthält: - rdp_client.py: RDP Client mit GUI und Monitor-Auswahl - rdp.sh: Bash-basierter RDP Client - teamleader_test/: Network Scanner Fullstack-App - teamleader_test2/: Network Mapper CLI Subdirectories mit eigenem Repo wurden ausgeschlossen. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
24
teamleader_test2/tests/test_scanner.py
Normal file
24
teamleader_test2/tests/test_scanner.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Basic unit tests for the LAN graph scanner helpers."""
|
||||
from network_mapper.scanner import ConnectionEdge, HostNode, ScanResult, parse_neighbor_ips
|
||||
|
||||
|
||||
def test_parse_neighbor_ips_filters_ips():
|
||||
sample = """
|
||||
192.168.5.10 dev eth0 lladdr aa:bb:cc:dd:ee:ff REACHABLE
|
||||
invalid line
|
||||
192.168.5.11 dev eth0 lladdr 11:22:33:44:55:66 STALE
|
||||
"""
|
||||
|
||||
parsed = parse_neighbor_ips(sample)
|
||||
assert parsed == {"192.168.5.10", "192.168.5.11"}
|
||||
|
||||
|
||||
def test_scan_result_dict_includes_nodes_and_edges():
|
||||
nodes = [HostNode(ip="10.0.0.5", dns_name="node", reachable=True, last_seen=0.0)]
|
||||
edges = [ConnectionEdge(source="10.0.0.1", target="10.0.0.5", relation="gateway")]
|
||||
scan_result = ScanResult(cidr="10.0.0.0/24", gateway="10.0.0.1", nodes=nodes, edges=edges, generated_at=0.0)
|
||||
payload = scan_result.to_dict()
|
||||
|
||||
assert payload["cidr"] == "10.0.0.0/24"
|
||||
assert payload["nodes"][0]["ip"] == "10.0.0.5"
|
||||
assert payload["edges"][0]["relation"] == "gateway"
|
||||
Reference in New Issue
Block a user