mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-31 07:12:23 -07:00
FIX: lowercase MAC normalization across project v0.3
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ def client():
|
||||
@pytest.fixture(scope="session")
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
|
||||
@@ -24,7 +24,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
|
||||
@@ -26,7 +26,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
@@ -115,7 +115,7 @@ def test_get_events_totals(client, api_token):
|
||||
def test_delete_all_events(client, api_token, test_mac):
|
||||
# create two events
|
||||
create_event(client, api_token, test_mac)
|
||||
create_event(client, api_token, "FF:FF:FF:FF:FF:FF")
|
||||
create_event(client, api_token, "ff:ff:ff:ff:ff:ff")
|
||||
|
||||
resp = list_events(client, api_token)
|
||||
# At least the two we created should be present
|
||||
|
||||
@@ -23,7 +23,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
|
||||
@@ -24,7 +24,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
|
||||
@@ -200,7 +200,7 @@ def test_set_device_alias_not_found(mock_update_col, client, api_token):
|
||||
mock_update_col.return_value = {"success": False, "error": "Device not found"}
|
||||
|
||||
payload = {"alias": "New Device Name"}
|
||||
response = client.post("/device/FF:FF:FF:FF:FF:FF/set-alias", json=payload, headers=auth_headers(api_token))
|
||||
response = client.post("/device/ff:ff:ff:ff:ff:ff/set-alias", json=payload, headers=auth_headers(api_token))
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.get_json()
|
||||
|
||||
@@ -19,7 +19,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
|
||||
@@ -26,7 +26,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
|
||||
@@ -24,7 +24,7 @@ def client():
|
||||
@pytest.fixture
|
||||
def test_mac():
|
||||
# Generate a unique MAC for each test run
|
||||
return "AA:BB:CC:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
return "aa:bb:cc:" + ":".join(f"{random.randint(0, 255):02X}" for _ in range(3))
|
||||
|
||||
|
||||
def auth_headers(token):
|
||||
|
||||
Reference in New Issue
Block a user