@@ -179,43 +179,43 @@ def test_get_config(tmp_path, monkeypatch):
179179 assert talkpipe .util .config ._config is None
180180
181181 # Add environment variables in a controlled way
182- monkeypatch .setenv ("TALKPIPE_" + talkpipe .llm . config .TALKPIPE_MODEL_NAME , "llama3.1" )
183- monkeypatch .setenv ("TALKPIPE_" + talkpipe .llm . config .TALKPIPE_SOURCE , "ollama" )
184-
182+ monkeypatch .setenv ("TALKPIPE_" + talkpipe .util . constants .TALKPIPE_MODEL_NAME , "llama3.1" )
183+ monkeypatch .setenv ("TALKPIPE_" + talkpipe .util . constants .TALKPIPE_SOURCE , "ollama" )
184+
185185 # When no configuration file exists, get_config will initialize the config.
186186 cfg = talkpipe .util .config .get_config (path = test_path )
187187 assert talkpipe .util .config ._config is not None
188188 assert len (cfg ) == 2
189- assert talkpipe .llm . config .TALKPIPE_MODEL_NAME in cfg
190- assert talkpipe .llm . config .TALKPIPE_SOURCE in cfg
189+ assert talkpipe .util . constants .TALKPIPE_MODEL_NAME in cfg
190+ assert talkpipe .util . constants .TALKPIPE_SOURCE in cfg
191191
192192 # Write a configuration file with values that differ from the env vars.
193193 with open (test_path , "w" ) as file :
194194 file .write (
195195 """
196196 %s = "silly"
197197 %s = "beans"
198- """ % (talkpipe .llm . config .TALKPIPE_MODEL_NAME , talkpipe .llm . config .TALKPIPE_SOURCE )
198+ """ % (talkpipe .util . constants .TALKPIPE_MODEL_NAME , talkpipe .util . constants .TALKPIPE_SOURCE )
199199 )
200200
201201 # Reload the config: env vars should override the values in the file.
202202 cfg = talkpipe .util .config .get_config (path = test_path , reload = True )
203203 assert len (cfg ) == 2
204204 # The environment variable values take precedence over the file.
205- assert cfg [talkpipe .llm . config .TALKPIPE_MODEL_NAME ] == "llama3.1"
206- assert cfg [talkpipe .llm . config .TALKPIPE_SOURCE ] == "ollama"
205+ assert cfg [talkpipe .util . constants .TALKPIPE_MODEL_NAME ] == "llama3.1"
206+ assert cfg [talkpipe .util . constants .TALKPIPE_SOURCE ] == "ollama"
207207
208208 # Remove environment variables to test file-only mode
209- monkeypatch .delenv ("TALKPIPE_" + talkpipe .llm . config .TALKPIPE_MODEL_NAME )
210- monkeypatch .delenv ("TALKPIPE_" + talkpipe .llm . config .TALKPIPE_SOURCE )
209+ monkeypatch .delenv ("TALKPIPE_" + talkpipe .util . constants .TALKPIPE_MODEL_NAME )
210+ monkeypatch .delenv ("TALKPIPE_" + talkpipe .util . constants .TALKPIPE_SOURCE )
211211
212212 talkpipe .util .config .reset_config ()
213213 # Here, ignore_env=True tells get_config to load values directly from the file.
214214 cfg = talkpipe .util .config .get_config (path = test_path , reload = True , ignore_env = True )
215215 assert len (cfg ) == 2
216- assert cfg [talkpipe .llm . config .TALKPIPE_MODEL_NAME ] == "silly"
217- assert cfg [talkpipe .llm . config .TALKPIPE_SOURCE ] == "beans"
218-
216+ assert cfg [talkpipe .util . constants .TALKPIPE_MODEL_NAME ] == "silly"
217+ assert cfg [talkpipe .util . constants .TALKPIPE_SOURCE ] == "beans"
218+
219219 finally :
220220 # Ensure we reset everything at the end
221221 talkpipe .util .config .reset_config ()
0 commit comments