Skip to content

Cover missing colo metadata in preamble#14

Open
KairosOps wants to merge 1 commit into
12932:masterfrom
KairosOps:fix/preamble-missing-colo-metadata
Open

Cover missing colo metadata in preamble#14
KairosOps wants to merge 1 commit into
12932:masterfrom
KairosOps:fix/preamble-missing-colo-metadata

Conversation

@KairosOps

Copy link
Copy Markdown

Fixes #13.

Cloudflare metadata can omit colo or return it as null. The current fallback path should report Unknown instead of crashing, but the test suite only exercised the live endpoint and did not pin down that response shape.

This adds mocked preamble() coverage for both missing and null colo metadata, so the fallback stays covered without relying on the live Cloudflare response.

Checked locally:

  • python -m pytest tests\all_test.py::test_preamble_handles_missing_colo_metadata -q
  • python -m py_compile cf_speedtest\speedtest.py tests\all_test.py
  • python -m pytest -q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'upper'

1 participant