Skip to content

Update Ecosystems Mock Test #5073

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

NeilMathew-git
Copy link

This PR adds two mock-based unit tests for the update_ecosystems method in osv_source.py to improve coverage without relying on external API calls or real gsutil interactions.

test_update_ecosystems_mocked:
Uses patch to mock out aio_run_command and simulate a basic case where a single ecosystem (ecosystem1) is listed and includes an all.zip file. Verifies that it's correctly recognized and stored.

test_update_ecosystems:
Tests the scenario where multiple ecosystems (python, rust) are listed, but only one (python) includes all.zip. Confirms that rust is excluded from the final result.

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up: it still looks like some of the test code is in the incorrect file.

@NeilMathew-git
Copy link
Author

Sorry, I forgot to add one of the files when commiting. I just edited the PR on github directly, let me know if there is any other problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants