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

enhancement(http/routing): improve test coverage #1327

Merged
merged 3 commits into from
Dec 12, 2021
Merged

enhancement(http/routing): improve test coverage #1327

merged 3 commits into from
Dec 12, 2021

Conversation

zeylahellyer
Copy link
Member

Improve the test coverage of the twilight_http::routing::route_display module by testing the Display implementations of routes.

This also fixes route implementations for three routes, discovered by creating these tests:

  • Create Guild Prune w/ include_roles query param
  • Sync Guild Integration
  • Update Current User Voice State

Todo:

  • add tests for remaining conditional routes (routes with optional query parameters)

Improve the test coverage of the `twilight_http::routing::route_display`
module by testing the `Display` implementations of routes.

This also fixes route implementations for three routes, discovered by
creating these tests:

- Create Guild Prune w/ `include_roles` query param
- Sync Guild Integration
- Update Current User Voice State

Signed-off-by: Zeyla Hellyer <[email protected]>
@zeylahellyer zeylahellyer added c-http Affects the http crate t-enhancement labels Dec 11, 2021
@zeylahellyer zeylahellyer merged commit 977c026 into twilight-rs:main Dec 12, 2021
@zeylahellyer zeylahellyer deleted the enhancement-http-route-display-test-coverage branch December 12, 2021 14:41
7596ff added a commit that referenced this pull request Dec 15, 2021
Additions

Add the API error codes `20029 WriteActionsReached` and `50055
InvalidGuild` ([#1326] - [@zeylahellyer]).

Changes

Only send the interaction authorization token when responding to
interactions ([#1317] - [@zeylahellyer]).

Fixes

Fix an issue where interaction and webhook tokens were invalidating the
entire client ([#1318] - [@zeylahellyer]). The client now only
invalidates a token if the request that failed was actually using it.

`CommandBorrowed::kind` is now properly serialized as `type` ([#1323] -
[@7596ff]).

Fix a variety of routes in `RouteDisplay` after adding tests ([#1327] -
[@zeylahellyer]). The fixed routes are `CreateGuildPrune`,
`SyncGuildIntegration`, and `UpdateUserVoiceState`.

[#1317]: #1317
[#1318]: #1318
[#1323]: #1323
[#1326]: #1326
[#1327]: #1327

[@7596ff]: https://github.com/7596ff
[@zeylahellyer]: https://github.com/zeylahellyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-http Affects the http crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant