1010 '"kernels_dir": "~/ciq/kernels",'
1111 '"images_source_dir": "~/ciq/default_test_images",'
1212 '"images_dir": "~/ciq/tmp/virt-images",'
13- '"ssh_key": "~/ciq/id_ed25519_generic.pub"'
13+ '"ssh_key": "~/ciq/id_ed25519_generic.pub",'
14+ '"user": "testuser"'
1415 "}"
1516)
1617
1718
18- def test_config_load_default_fallback ():
19+ def test_config_load_default_fallback (monkeypatch ):
20+ # Remove the environment variable if it exists when running local tests
21+ monkeypatch .delenv ("KTOOLS_CONFIG_FILE" , raising = False )
1922 config = Config .load ()
2023 assert config .base_path == DEFAULT_CONFIG ["base_path" ]
2124
@@ -47,7 +50,7 @@ def test_config_load_from_json_data_None():
4750def test_config_load_from_json_data_empty ():
4851 json_data = "{}"
4952
50- with pytest .raises (TypeError , match = "missing 5 required positional arguments:" ):
53+ with pytest .raises (TypeError , match = "missing 6 required positional arguments:" ):
5154 config = Config .from_json (json_data ) # noqa F841
5255
5356
@@ -74,3 +77,8 @@ def test_config_load_from_json_proper_images_dir():
7477def test_config_load_from_json_proper_ssh_key ():
7578 config = Config .from_json (CONFIG_STR )
7679 assert config .ssh_key == Path ("~/ciq/id_ed25519_generic.pub" ).expanduser ()
80+
81+
82+ def test_config_load_from_json_proper_user ():
83+ config = Config .from_json (CONFIG_STR )
84+ assert config .user == "testuser"
0 commit comments