Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/components/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,12 @@ def test_handles_multiple_macs(self):
assert "11:22:33:44:55:66" not in sanitized
assert "99-88-77-66-55-44" not in sanitized
# har-capture uses format-preserving hashes (02:xx:xx:xx:xx:xx) for MACs
# Should have 3 redacted MACs
assert sanitized.count("02:") == 3 or sanitized.count("XX:XX:XX:XX:XX:XX") == 3
# All 3 original MACs should be replaced (don't count "02:" substrings
# since redacted hashes can also contain "02:" in middle octets)
import re

redacted_macs = re.findall(r"02:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}", sanitized)
assert len(redacted_macs) == 3

def test_handles_empty_string(self):
"""Test that empty string is handled gracefully."""
Expand Down
Loading