-
Notifications
You must be signed in to change notification settings - Fork 98
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
Generate Unit Tests for github_service.py #175
Comments
@dhirenmathur I'd like to take up this issue. The tests should go into which folder? |
@Anu-Ra-g that's great, you should create a new folder in the root directory of the project called |
I'm using this for setting up the
Will it be okay? |
@Anu-Ra-g I would recommend to stick to creating the init file, this approach could end up being difficult to maintain and run tests from other directories |
@Anu-Ra-g let us know if you need any help |
@Anu-Ra-g are you still working on this? |
Yes, I'm still working on this but I got a little busy. I will make the PR as soon as possible. |
Go ahead |
@dhirenmathur I'd like to solve this one as well if that is okay. |
@simin75simin let's do the issues one at a time so that others have a chance as well, there's already an open PR for this one too :) |
sorry just looking for things to contribute and this one seemed dormant |
You are right that this is dormant @simin75simin, if we can validate that no work is needed in the other issue, you can pick this up! Thank you! |
Description:
We need to create unit tests for the
github_service.py
file located in theapp/modules/github/
directory. The goal is to ensure that all functions are thoroughly tested for expected behavior, edge cases, and error handling.Functions to Test:
get_github_repo_details: Test the retrieval of GitHub repository details, including handling of invalid repository names and API errors.
get_file_content: Validate file content retrieval, including:
start_line
andend_line
.get_repos_for_user: Validate the retrieval of repositories for a user, including error handling for missing users and tokens.
get_combined_user_repos: Test the combination of user repositories and project repositories, ensuring no duplicates.
get_branch_list: Validate branch retrieval, including error handling for non-existent repositories.
get_public_github_instance: Ensure that a public GitHub instance is returned correctly.
get_repo: Test the retrieval of a repository, including handling of both private and public access failures.
get_project_structure_async: Validate the fetching of project structure, including caching behavior.
Testing Framework:
pytest
for writing the unit tests.pytest-mock
orunittest.mock
to mock external dependencies like GitHub API calls and database interactions.Acceptance Criteria:
Additional Notes:
The text was updated successfully, but these errors were encountered: