FIX: lowercase MAC normalization across project v0.2

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-02-07 14:02:54 +11:00
parent 946ad00253
commit 827b5d2ad3
11 changed files with 42 additions and 40 deletions

View File

@@ -31,7 +31,7 @@ def client():
@pytest.fixture
def test_mac():
"""Generate a test MAC address."""
return "AA:BB:CC:DD:EE:FF"
return "aa:bb:cc:dd:ee:ff"
@pytest.fixture

View File

@@ -38,7 +38,7 @@ def test_ipv6_update_preserves_ipv4(scan_db, mock_device_handling):
# 1⃣ Create device with IPv4
cur.execute(
"INSERT INTO Devices (devMac, devLastIP, devPrimaryIPv4, devName) VALUES (?, ?, ?, ?)",
("AA:BB:CC:DD:EE:FF", "192.168.1.10", "192.168.1.10", "Device")
("aa:bb:cc:dd:ee:ff", "192.168.1.10", "192.168.1.10", "Device")
)
# 2⃣ Insert a scan reporting IPv6
@@ -47,7 +47,7 @@ def test_ipv6_update_preserves_ipv4(scan_db, mock_device_handling):
INSERT INTO CurrentScan (scanMac, scanLastIP, scanSourcePlugin, scanLastConnection)
VALUES (?, ?, ?, ?)
""",
("AA:BB:CC:DD:EE:FF", "2001:db8::1", "TEST_PLUGIN", "2025-01-01 01:00:00")
("aa:bb:cc:dd:ee:ff", "2001:db8::1", "TEST_PLUGIN", "2025-01-01 01:00:00")
)
scan_db.commit()
@@ -61,7 +61,7 @@ def test_ipv6_update_preserves_ipv4(scan_db, mock_device_handling):
# 4⃣ Verify the device fields
row = cur.execute(
"SELECT devLastIP, devPrimaryIPv4, devPrimaryIPv6 FROM Devices WHERE devMac = ?",
("AA:BB:CC:DD:EE:FF",),
("aa:bb:cc:dd:ee:ff",),
).fetchone()
assert row["devLastIP"] == "2001:db8::1" # Latest IP is now IPv6