-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move ocpp.FormationViolation to Endpoint (BC) #232
Move ocpp.FormationViolation to Endpoint (BC) #232
Conversation
@lorenzodonini if you want to follow with this PR I would need your help with the tests. The client and centralsystem implementations are private, hence tests from different packages cannot access the endpoint afaikt. It could be an option to move these specific tests to the 1.6/2.0 folders them selves. Adding a public api seems too much. The ocppj tests look wrong to me- since they never setup a server/client they cannot validate against endpoint's format. |
What do you mean? Server/client are created for each test within the What tests are broken exactly? Happy to help and think of something. |
Afaikt they create mock client/servers. Missing the endpoint they cannot be used to test for the endpoint's format. |
5d4aaae
to
37743bb
Compare
All the failing tests are checking against the removed global var. To fix them, I suggest simply changing
|
Thank you, updated accordingly. That fixes it for ocppj. for ocpp16 and 20 the constructors are private and the tests are in a separate folder. Any idea how to tackle this? |
Hello, |
add get FormatError method & fix test
Co-authored-by: lorenzodonini <[email protected]>
Tests currently panic since I have tried removing the default version for the test suite:
Tbo, it is not clear for me why there should be a default version. Which default version should an endpoint have when it is being constructed? This feels like some sort of logical gap that we might fix while we're at it. @lorenzodonini Is this a logical error in where the endpoint dialect (which is what I'm currently calling it) is being set or is this rather a mistake in the tests that should not test that specific property in these tests? |
Error caused by dialect that not set to any version, and then the dialect value is 0, that it's made panic on Suppose when Have you like to traced it with go test for first error method test, like:
|
To avoid mistake or logical gap, prefer need to make two different test version between:
and
This might be fairly test. |
Finished from my side. Didn‘t get rid of the test default but that should be acceptable. |
@lorenzodonini addressed comments- done. I like it, much appreciated! Small comment: note the calls to |
Fix #227
TODO