Add comprehensive unit tests for core modules#36
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Co-authored-by: cmagnobarbosa <10928556+cmagnobarbosa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Testes unitários
Add comprehensive unit tests for core modules
Jul 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added extensive unit test coverage for 5 core modules that previously lacked testing:
New Test Files Added
test_preprocessamento.py(5 tests) - Tests for text preprocessing utilities including accent removal with various edge casestest_exceptions.py(6 tests) - Tests for all custom exception classes including HTTP exceptions and parser errorstest_authentication.py(6 tests) - Tests for token verification with proper mocking of environment variablestest_servico_llm.py(5 tests) - Tests for LLM service functions with comprehensive mocking of external API callstest_constants.py(12 tests) - Tests for configuration constants, ENEM themes validation, and environment variable loadingKey Features
unittestframework and coding style as existing testsTechnical Improvements
authentication.pyto read environment variables within functions for better testabilityTest Results
All new tests pass successfully and provide robust coverage for the core functionality.
Fixes #23.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
huggingface.copython -m unittest discover tests/ -v(dns block)python -m unittest discover tests/ -k test_preprocessamento or test_exceptions or test_authentication or test_servico_llm or test_constants -v(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.