@@ -199,7 +199,30 @@ def test_env_only_required_filters_optional(capsys, monkeypatch):
199199 assert "SIMPLESPLITTERSTEP__BATCH_SIZE" not in captured .out
200200
201201
202- def test_env_gen_env_outputs_env_file (capsys , monkeypatch ):
202+ def test_env_gen_env_outputs_env_file (capsys , monkeypatch , env ):
203+ monkeypatch .setattr (main , "console" , main .console .__class__ (force_terminal = False , width = 200 ))
204+ env .set ("MANUALMARKDOWNSTEP__FOLDER_PATH" , "/tmp/custom" )
205+ env .set ("SIMPLESPLITTERSTEP__BATCH_SIZE" , "256" )
206+
207+ main .env_cmd ("examples.pipeline.pipelinedemo:pipeline" , gen_env = True )
208+ captured = capsys .readouterr ()
209+ expected = (
210+ "# Generated env vars\n \n "
211+ "# ManualMarkdownStep\n "
212+ "MANUALMARKDOWNSTEP__FOLDER_PATH=/tmp/custom\n \n " # pragma: allowlist secret
213+ "# SimpleSplitterStep\n "
214+ "SIMPLESPLITTERSTEP__BATCH_SIZE=256\n "
215+ "SIMPLESPLITTERSTEP__NUM_THREADS=4\n "
216+ "SIMPLESPLITTERSTEP__TOKEN_COUNT_MIN=64\n "
217+ "SIMPLESPLITTERSTEP__TOKEN_COUNT_MAX=1024\n "
218+ "SIMPLESPLITTERSTEP__TOKEN_COUNT_BUFFER=32\n "
219+ "SIMPLESPLITTERSTEP__TOKENIZER_MODEL=gpt-3.5-turbo\n "
220+ "SIMPLESPLITTERSTEP__SENTENCE_SPLITTER_MODEL=de_core_news_sm\n \n \n "
221+ )
222+ assert captured .out == expected
223+
224+
225+ def test_env_gen_env_outputs_env_file_empty (capsys , monkeypatch ):
203226 monkeypatch .setattr (main , "console" , main .console .__class__ (force_terminal = False , width = 200 ))
204227 main .env_cmd ("examples.pipeline.pipelinedemo:pipeline" , gen_env = True )
205228 captured = capsys .readouterr ()
0 commit comments