fix: remove duplicate IANA registry entry causing false update reports

This commit is contained in:
Heiko
2025-12-19 20:22:35 +01:00
parent 753c582010
commit 0b09de7d1e
4 changed files with 41 additions and 7 deletions

BIN
compliance_status.db Normal file

Binary file not shown.

View File

@@ -529,9 +529,9 @@ poetry run pytest tests/ -v
- `tests/test_cli.py`: 3 CLI parsing tests
- `tests/test_iana_validator.py`: 20 IANA validation tests
- `tests/test_iana_parse.py`: 14 IANA parsing tests
- `tests/test_iana_update.py`: 13 IANA update tests
- `tests/test_iana_update.py`: 14 IANA update tests
**Total:** 63 tests
**Total:** 64 tests
**Test database setup:**

View File

@@ -24,11 +24,6 @@
"tls-parameters-5",
"tls_content_types.csv",
["Value", "Description", "DTLS", "Recommended", "RFC/Draft"]
],
[
"tls-parameters-7",
"tls_content_types.csv",
["Value", "Description", "DTLS", "Recommended", "RFC/Draft"]
]
],
"https://www.iana.org/assignments/ikev2-parameters/ikev2-parameters.xml": [

View File

@@ -283,3 +283,42 @@ class TestDiffCalculationEdgeCases:
assert "0x03" in diff["added"]
assert "0x02" in diff["deleted"]
assert "0x01" in diff["modified"]
class TestConsecutiveUpdates:
"""Tests for consecutive IANA updates."""
def test_consecutive_updates_show_no_changes(self, test_db_path: str) -> None:
"""Test that second update with same data shows no changes."""
xml_path = "tests/fixtures/iana_xml/tls-parameters-minimal.xml"
with open(xml_path, encoding="utf-8") as f:
xml_content = f.read()
conn = sqlite3.connect(test_db_path)
headers = ["Value", "Description", "DTLS", "Recommended", "RFC/Draft"]
row_count_1, diff_1 = process_registry_with_validation(
xml_content,
"tls-parameters-4",
"iana_tls_cipher_suites",
headers,
conn,
skip_min_rows_check=True,
)
row_count_2, diff_2 = process_registry_with_validation(
xml_content,
"tls-parameters-4",
"iana_tls_cipher_suites",
headers,
conn,
skip_min_rows_check=True,
)
assert row_count_1 == row_count_2
assert len(diff_2["added"]) == 0
assert len(diff_2["deleted"]) == 0
assert len(diff_2["modified"]) == 0
conn.close()