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

Refactor test to implement asyncio run and test error detection instead of False being return #59

Open
2 tasks
MaxenceGui opened this issue Mar 5, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@MaxenceGui
Copy link

Issue description

Currently, the tests for the backend contain code maintenance issues and some wrong test assertions. The use of the asyncio loop makes it difficult to maintain and understand the code while the unsuccessful test looks for a return False statement instead of an exception raised by the function that is being tested.

Work to do

  • Use the run function from asyncio to collect the result from the asyncio function.
  • Change the unsuccessful function to assertRaise instead of assertEqual

Acceptance criteria

  1. The test functions do not manually create a new loop before running a test
  2. assertRaise exception instead of assertEqual for a False return

Tasks

  • Modify test_azure_storage_api to test raise Errors from azure_storage_api module
  • Modify the test to use aynscio.run instead of an async loop.
@sylvanie85
Copy link
Contributor

Is that issue still relevant ? The tests already all use asyncio.run() and there is already assertRaise in the unsuccessful tests.

What do you think ? @ChromaticPanic @Francois-Werbrouck

@Francois-Werbrouck
Copy link
Contributor

Francois-Werbrouck commented May 15, 2024

We are not using the azure_storage_api module anymore, also once #61 is merged, most functions return will already have been modified. I'd wait for the merge to double check all functions before officially closing this issue (if no-one else see's a problem with closing this)

@Francois-Werbrouck Francois-Werbrouck moved this from Todo to On Hold in Nachet Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Paused
Development

No branches or pull requests

4 participants