Skip to content

Implement config unit testing #516

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 130 commits into
base: main
Choose a base branch
from

Conversation

MattyTheHacker
Copy link
Member

No description provided.

@MattyTheHacker MattyTheHacker self-assigned this May 30, 2025
@MattyTheHacker MattyTheHacker added the test suite Changes and additions to the project test suite and unit tests label May 30, 2025
@MattyTheHacker MattyTheHacker linked an issue May 30, 2025 that may be closed by this pull request
Copy link

codecov bot commented May 30, 2025

Codecov Report

Attention: Patch coverage is 77.34375% with 29 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
utils/context_managers.py 58.46% 21 Missing and 6 partials ⚠️
utils/random_generators.py 95.91% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@MattyTheHacker MattyTheHacker force-pushed the 515-implement-config-unit-testing branch from 9c5a784 to 782bcfd Compare May 30, 2025 17:49
@MattyTheHacker MattyTheHacker requested a review from Copilot July 11, 2025 07:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new utility modules for generating random environment values and managing temporary resource changes, expands package exports, reorganizes tests, updates project dependencies, and fixes a guard in config parsing.

  • Introduce random_generators.py for creating mock Discord tokens, guild IDs, webhook URLs, and organisation IDs.
  • Add context_managers.py with context managers for deleting environment variables, temporary file removal, and settings replacement.
  • Update __init__.py, adjust pyproject.toml dependency groups and lint rules, remove deprecated tests, add a focused test for generate_invite_url, and guard against None in config.py.

Reviewed Changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
utils/random_generators.py New random value generators for environment variables
utils/context_managers.py New context managers for env var deletion, file deletion, and settings
utils/init.py Exported the new generators and context managers
tests/test_utils.py Removed outdated, monolithic test suite
tests/test_generate_invite_url.py Added dedicated test for generate_invite_url
pyproject.toml Refactored dependency groups and expanded lint ignores for tests
config.py Added a truthiness check before calling strip() on config values
Comments suppressed due to low confidence (2)

utils/random_generators.py:1

  • The new random value generators currently lack dedicated unit tests. Add tests to verify that generated tokens, IDs, and URLs match expected patterns and constraints.
"""Module for generating random values for environment variables."""

utils/context_managers.py:1

  • Context managers for environment variable deletion, settings replacement, and file deletion are not covered by tests. Consider adding unit tests to ensure they properly delete, restore, and handle edge cases.
"""Module containing context managers for temporary deletions and replacements."""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sync Keep this PR up to date with it's base branch test suite Changes and additions to the project test suite and unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement config unit testing
3 participants