Skip to content

Deduplicate and simplify Expires header test code. - #643

Merged
adk-swisstopo merged 1 commit into
developfrom
PB-1403-test
Jun 2, 2026
Merged

Deduplicate and simplify Expires header test code.#643
adk-swisstopo merged 1 commit into
developfrom
PB-1403-test

Conversation

@adk-swisstopo

@adk-swisstopo adk-swisstopo commented May 29, 2026

Copy link
Copy Markdown
Member

We test that the Expires header is set correctly in four different scenarios. The code extracting and comparing the header is duplicated four times.

This change moves the code into a method which is called in each of the four cases with slightly different parametres. We also simplify the checks to let assertAlmostEqual and assertIn do the work themselves. This gives us better error messages too.

@adk-swisstopo
adk-swisstopo force-pushed the PB-1403-test branch 3 times, most recently from 421d316 to f4b53c7 Compare May 29, 2026 11:18
We test that the `Expires` header is set correctly in four different scenarios.
The code extracting and comparing the header is duplicated four times.

This change moves the code into a method which is called in each of the four
cases with slightly different parametres. We also simplify the checks to let
`assertAlmostEqual` and `assertIn` do the work themselves. This gives us better
error messages too.
@adk-swisstopo adk-swisstopo changed the title PB-1403: just testing Deduplicate and simplify Expires header test code. May 29, 2026
@adk-swisstopo
adk-swisstopo marked this pull request as ready for review May 29, 2026 11:39
@adk-swisstopo
adk-swisstopo requested a review from ltshb May 29, 2026 11:39
@adk-swisstopo
adk-swisstopo merged commit 1d138be into develop Jun 2, 2026
7 checks passed
@adk-swisstopo
adk-swisstopo deleted the PB-1403-test branch June 2, 2026 06:46
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.

2 participants