Add failing tests for #451: default_language ignored in language detection#462
Draft
Serhan-Asad wants to merge 1 commit intopromptdriven:mainfrom
Draft
Add failing tests for #451: default_language ignored in language detection#462Serhan-Asad wants to merge 1 commit intopromptdriven:mainfrom
Serhan-Asad wants to merge 1 commit intopromptdriven:mainfrom
Conversation
…d in language detection
This commit adds comprehensive test coverage that reproduces the bug where
the default_language setting in .pddrc is ignored during language detection.
Tests added:
- Unit test: test_default_language_fallback_from_pddrc in test_construct_paths.py
- E2E test suite: test_e2e_issue_451_default_language.py with 5 comprehensive tests
Both test suites currently FAIL, correctly detecting the bug where:
- Configuration loads default_language correctly into command_options
- _determine_language() checks command_options.get("language") (wrong key)
- Function never checks command_options.get("default_language") as fallback
- Error is raised without using the configured default
The tests will PASS once the fix is applied (adding fallback check for
default_language before raising error at line 762 in construct_paths.py).
Related to promptdriven#451
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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
Adds failing tests that detect the bug reported in #451 where the
default_languagesetting in.pddrcis ignored during language detection.Test Files
tests/test_construct_paths.py::test_default_language_fallback_from_pddrctests/test_e2e_issue_451_default_language.py(5 comprehensive tests)What This PR Contains
Root Cause
Location:
pdd/construct_paths.py:688in_determine_language()Issue: Key name mismatch where:
command_options["default_language"]command_options.get("language")(wrong key!)default_languagebefore raising error at line 762Impact: Users configure
default_language: pythonin.pddrc, butpdd generate test.prompt(without language suffix) fails with "Could not determine language from input files or options."The Fix
Add 4 lines before line 762 in
pdd/construct_paths.py:This establishes the correct priority order:
--languageflag (highest priority)Test Coverage
The test suite verifies:
default_languagefrom.pddrcis used as fallbackNext Steps
pdd/construct_paths.py:762pytest tests/test_construct_paths.py::test_default_language_fallback_from_pddrc -vpytest tests/test_e2e_issue_451_default_language.py -vpytest tests/Fixes #451
Generated by PDD agentic bug workflow (Steps 1-10)