| 173 | |
| 174 | |
| 175 | class TestCompatibility: |
| 176 | def test_breaking_changes_major(self): |
| 177 | result = check_compatibility(_make_spec_v1(), _make_spec_v2()) |
| 178 | assert result.compatible is False |
| 179 | assert result.severity == "MAJOR" |
| 180 | assert len(result.breaking_changes) > 0 |
| 181 | |
| 182 | def test_identical_is_compatible(self): |
| 183 | spec = _make_spec_v1() |
| 184 | result = check_compatibility(spec, spec) |
| 185 | assert result.compatible is True |
| 186 | assert result.severity == "PATCH" |
| 187 | |
| 188 | def test_minor_change(self): |
| 189 | """Adding only an optional param → MINOR.""" |
| 190 | old = LAPSpec(api_name="T", endpoints=[ |
| 191 | Endpoint(method="get", path="/x", required_params=[], optional_params=[], |
| 192 | request_body=[], response_schemas=[], error_schemas=[]), |
| 193 | ]) |
| 194 | new = LAPSpec(api_name="T", endpoints=[ |
| 195 | Endpoint(method="get", path="/x", required_params=[], |
| 196 | optional_params=[Param("foo", "str")], |
| 197 | request_body=[], response_schemas=[], error_schemas=[]), |
| 198 | ]) |
| 199 | result = check_compatibility(old, new) |
| 200 | assert result.compatible is True |
| 201 | assert result.severity == "MINOR" |
| 202 | |
| 203 | |
| 204 | class TestChangelog: |
nothing calls this directly
no outgoing calls
no test coverage detected