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

Backend [Integration Test] bots.go handlers CreateOrEditBot, GetListedBots, & GetBot #1565

Closed
2 tasks
elraphty opened this issue Feb 27, 2024 · 4 comments · Fixed by #1577
Closed
2 tasks
Assignees
Labels
backend bounties go Pull requests that update Go code Posted testing
Milestone

Comments

@elraphty
Copy link
Contributor

Context

We are trying to increase the test coverage for our Golang backend.

File to to test

handlers/bots.go

Design

Write tests for the bots handlers, the test should:

  • CreateOrEditBot: Should test that a 401 error is returned during bot creation if there is no bot uuid
  • CreateOrEditBot: Should test that a 401 error is returned if the user public key can't be verified during bot creation
  • CreateOrEditBot: This should test that a bot gets created successfully if an authenticated user sends the right data
  • CreateOrEditBot: Should test that an existing bot gets updated when passed to POST bots
  • GetBot: Should test that a bot can be fetched with its uuid
  • GetListedBots: Should test that all bots that are not unlisted or deleted get listed

Bots Handlers To Test

CreateOrEditBot
GetListedBots
GetBot

Add tests to bots_test.go

Acceptance Criteria

  • I have rebased and tested locally before submitting my PR
  • I can submit a PR within 2 days of taking the bounty

References

Here is an example backend test

@FaisalIqbal211
Copy link
Contributor

@ecurrencyhodler assign me?

@elraphty elraphty added backend bounties go Pull requests that update Go code testing labels Feb 27, 2024
@elraphty elraphty added this to the UCI Tests milestone Feb 27, 2024
@Jagmohan2k
Copy link

@ecurrencyhodler can you assign me

@MirzaHanan
Copy link
Contributor

@ecurrencyhodler,
Please assign me?

@ecurrencyhodler ecurrencyhodler moved this from 🆕 New to 🧨 To Do in Bounties Platform Feb 27, 2024
@Fog3211
Copy link
Contributor

Fog3211 commented Feb 27, 2024

@ecurrencyhodler can i take this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bounties go Pull requests that update Go code Posted testing
Projects
Status: ✅ Done
6 participants