Problem
Most tests only assert status_code == 200 and that expected keys exist in the response. They do not verify the actual values returned. For example:
test_compare_configs doesn't assert that has_changes is True.
test_search_config doesn't assert that the matches actually contain the expected interface lines or that match_count > 0.
test_parse_config doesn't assert anything about the structure of structured_config.
These tests would pass even if the services returned incorrect data.
Suggested Fix
Add value assertions to each test. For example:
def test_compare_configs(...):
...
assert data["has_changes"] is True
assert "hostname" in data["unified_diff"]
def test_search_config(...):
...
assert data["match_count"] == 2
assert any("GigabitEthernet0/0" in m for m in data["matches"])
Problem
Most tests only assert
status_code == 200and that expected keys exist in the response. They do not verify the actual values returned. For example:test_compare_configsdoesn't assert thathas_changesisTrue.test_search_configdoesn't assert that the matches actually contain the expected interface lines or thatmatch_count > 0.test_parse_configdoesn't assert anything about the structure ofstructured_config.These tests would pass even if the services returned incorrect data.
Suggested Fix
Add value assertions to each test. For example: