Skip to content

Test the default openapi example - #92

Merged
andig merged 4 commits into
evcc-io:mainfrom
achims311:main
Oct 24, 2026
Merged

andig merged 4 commits into
evcc-io:mainfrom
achims311:main

Conversation

@achims311

Copy link
Copy Markdown
Contributor

when calling the root ("/") one gets a test page for the API.
This page contains a default (empty) set of parameters.
Add these parameters to the test cases, as we don't want this case to fail.

As they fail, add a fix for this case.

the app shows on "/" an openapi/swagger screen which can be used to est the api of this app.

Create a testcase for exactly this call .
in the default case  p_max_imp_exc has no value
Comment thread test_cases/000-default-openapi-example.json Outdated
Comment thread src/optimizer/optimizer.py Outdated
Comment thread src/optimizer/optimizer.py Outdated
@andig
andig marked this pull request as draft October 4, 2026 13:10
andig added 2 commits October 24, 2026 10:47
The example on / sent a zero length step, a 500 from dividing by it, and a
battery with c_max and d_max 0, whose charge discharge gate was left in no
row and came back without a value, failing the feasibility check as Not Solved.

- reject a non-positive dt with a 400 naming the step, prefill dt with 3600
- skip the gate for a battery that can neither charge nor discharge
- test the example generated from /swagger.json instead of storing it
@andig
andig marked this pull request as ready for review October 24, 2026 09:10
@andig andig changed the title test default openapi/swgger case Test the default openapi example Oct 24, 2026
@andig
andig merged commit 04f79ca into evcc-io:main Oct 24, 2026
1 check passed
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