File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,13 +259,25 @@ def mock_llm(msgs, action=""):
259259class TestLengthEnforcementConfig :
260260 """Verify config constants exist and have sensible defaults."""
261261
262- def test_chapter_min_length_pct_default (self ):
262+ def test_chapter_min_length_pct_default (self , monkeypatch ):
263+ import importlib
263264 import novelforge .config as cfg
264- assert cfg .CHAPTER_MIN_LENGTH_PCT == 85
265-
266- def test_max_expansion_attempts_default (self ):
265+ monkeypatch .delenv ("CHAPTER_MIN_LENGTH_PCT" , raising = False )
266+ importlib .reload (cfg )
267+ try :
268+ assert cfg .CHAPTER_MIN_LENGTH_PCT == 85
269+ finally :
270+ importlib .reload (cfg )
271+
272+ def test_max_expansion_attempts_default (self , monkeypatch ):
273+ import importlib
267274 import novelforge .config as cfg
268- assert cfg .MAX_EXPANSION_ATTEMPTS == 2
275+ monkeypatch .delenv ("MAX_EXPANSION_ATTEMPTS" , raising = False )
276+ importlib .reload (cfg )
277+ try :
278+ assert cfg .MAX_EXPANSION_ATTEMPTS == 2
279+ finally :
280+ importlib .reload (cfg )
269281
270282 def test_chapter_min_length_pct_in_all (self ):
271283 import novelforge .config as cfg
You can’t perform that action at this time.
0 commit comments