"All new business logic should have corresponding unit tests."
Description
This PR adds unit tests for the new business logic introduced in the app.py file of the RAGxplorer project. The new functionality includes additional UI elements and functionality related to querying and retrieving documents. The unit tests cover all possible scenarios and edge cases to ensure code quality and maintainability.
Summary of Changes
Created a new file test_app.py in the tests directory to contain the unit tests for the app.py file.
Imported the necessary modules and functions for testing.
Wrote comprehensive test cases to cover all the new functionality introduced in app.py.
Modified the existing code in app.py to make it testable and modular.
Extracted relevant functions and classes into separate modules to facilitate unit testing.
Ensured that the code follows best practices for testability, such as avoiding global state and using dependency injection where necessary.
Added comments and docstrings to explain the purpose and behavior of the code.
Please review and merge this PR to ensure proper test coverage for the new business logic in app.py.
PR Feedback (click)
I created this PR to address this rule:
"All new business logic should have corresponding unit tests."
Description
This PR adds unit tests for the new business logic introduced in the
app.py
file of the RAGxplorer project. The new functionality includes additional UI elements and functionality related to querying and retrieving documents. The unit tests cover all possible scenarios and edge cases to ensure code quality and maintainability.Summary of Changes
test_app.py
in thetests
directory to contain the unit tests for theapp.py
file.app.py
.app.py
to make it testable and modular.Please review and merge this PR to ensure proper test coverage for the new business logic in
app.py
.