Skip to content
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

patch: simplify mocktr181 HandleWrp and handle empty payload case #215

Merged

Conversation

denopink
Copy link
Contributor

@denopink denopink commented Aug 6, 2024

  • support empty payload case (520 status code)
  • simplify mocktr181 HandleWrp

- support empty payload case (520 status code)
- simplify mocktr181 HandleWrp
@denopink denopink added the bug Something isn't working label Aug 6, 2024
@denopink denopink self-assigned this Aug 6, 2024
statusCode = int64(520)
)

if len(wrpPayload) == 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support empty payload case (520 status code)

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.40%. Comparing base (22e2200) to head (9a7c36d).

Files Patch % Lines
internal/wrphandlers/mocktr181/handler.go 85.71% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #215   +/-   ##
=======================================
  Coverage   77.39%   77.40%           
=======================================
  Files          75       75           
  Lines        4640     4642    +2     
=======================================
+ Hits         3591     3593    +2     
  Misses        851      851           
  Partials      198      198           
Flag Coverage Δ
unittests 77.40% <85.71%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@denopink denopink merged commit e3a592f into main Aug 6, 2024
18 of 19 checks passed
@denopink denopink deleted the denopink/patch/simplify-mocktr181-HandleWrp-structure branch August 6, 2024 21:06
)

if len(wrpPayload) == 0 {
return statusCode, []byte(fmt.Sprintf(`{"message": ""Invalid Input Command"", "statusCode": %d}`, statusCode)), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we say empty so we know the payload is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would but that's the expected behavior of the old c simulator.

we're trying to match the old c simulator as close as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants