ai-cfia / nachet-backend

A flask-based backend for Nachet to handle Azure endpoint and Azure storage API requests from the frontend.
MIT License
1 stars 3 forks source link

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

Open MaxenceGui opened 4 months ago

MaxenceGui commented 4 months ago

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

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

sylvanie85 commented 2 months ago

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 commented 2 months ago

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)