Skip to content

test_util: Implement test for is_gitlab_instance #530

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

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

sonic2kk
Copy link
Contributor

This PR implements a test for the is_gitlab_instance utility function.

We test against each element in our GITLAB_API list constant using PyTest's Parametrize feature. Currently we only have one entry in this list, but if we had more in future, this would allow us to check to make sure if we add one that it this function should always work with all items in that list. We also then check a failing test case with the GitHub API to ensure that the function returns False when we expect it to.

Thanks!

@DavidoTek
Copy link
Owner

Awesome to see that the number of tests is growing, thanks!

PS: I may be a bit slow at reviewing currently due to some other projects...

@DavidoTek DavidoTek merged commit 82321e7 into DavidoTek:main Apr 24, 2025
2 checks passed
@sonic2kk
Copy link
Contributor Author

No problem! I spent a lot of time trying to figure out PyTest and good testing standards / practices, and when I finally felt like I understood, I decide to try and make good on my promise from a while back to actually write some tests.

The PRs for the tests are not testing functionality that I foresee changing, so there's no need to hurry on review :-) I did test merging them into main locally and it seems there'll be conflicts at some point so I'll resolve those once we get to them!

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