test: expand coverage for core config, utils, and batch parser#218
Open
Jah-yee wants to merge 2 commits intoHKUDS:mainfrom
Open
test: expand coverage for core config, utils, and batch parser#218Jah-yee wants to merge 2 commits intoHKUDS:mainfrom
Jah-yee wants to merge 2 commits intoHKUDS:mainfrom
Conversation
Made-with: Cursor
Collaborator
|
Made-with: Cursor
Author
|
Thanks for reviewing the test coverage PR and for pointing out these two issues. I removed the unused imports (tempfile, MagicMock, patch) from tests/test_core_modules.py, so Ruff no longer reports F401 warnings. For test_default_values, I now explicitly clear the relevant env vars via monkeypatch.delenv(...) (e.g. PARSER, PARSE_METHOD, MAX_CONCURRENT_FILES and related flags) before instantiating RAGAnythingConfig, so the test is deterministic and not sensitive to CI or local shell env. If you think it would be useful, I can also add a separate test that asserts env overrides are respected to complement the default-values test. |
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.
Summary
This PR adds a new test module to increase coverage for several core components that previously had little or no automated testing, including configuration, utility helpers, status enums, and the batch parser.
Motivation
Most existing tests focus on parser wiring and
paddleocrintegration. Core pieces such as configuration, content separation, image utilities, and the batch parser are either untested or only indirectly exercised, which makes refactoring risky. These tests aim to capture current behavior so future changes are safer.Changes
tests/test_core_modules.pybase.DocStatus,config.RAGAnythingConfig,utils.separate_content,utils.encode_image_to_base64,utils.validate_image_file,utils.get_processor_for_type,utils.get_processor_supports,batch_parser.BatchProcessingResult, andbatch_parser.BatchParserinitialization/basic behavior.Testing
pytestlocally includingtests/test_core_modules.py; all tests passed.Thanks for your work on RAG-Anything—if you prefer a different organization for these tests (e.g. split by module), I’m happy to rearrange them.