@@ -89,12 +89,72 @@ def test_configuration_with_ignores():
8989 assert "another.ignored" in config .ignore_keys
9090
9191
92+ def test_configuration_editable_install_mode ():
93+ """Test Configuration with editable install mode."""
94+ from mxdev .config import Configuration
95+
96+ base = pathlib .Path (__file__ ).parent / "data" / "config_samples"
97+ config = Configuration (str (base / "config_editable_mode.ini" ))
98+
99+ assert config .settings ["default-install-mode" ] == "editable"
100+ assert config .packages ["example.package" ]["install-mode" ] == "editable"
101+
102+
103+ def test_configuration_fixed_install_mode ():
104+ """Test Configuration with fixed install mode."""
105+ from mxdev .config import Configuration
106+
107+ base = pathlib .Path (__file__ ).parent / "data" / "config_samples"
108+ config = Configuration (str (base / "config_fixed_mode.ini" ))
109+
110+ assert config .settings ["default-install-mode" ] == "fixed"
111+ assert config .packages ["example.package" ]["install-mode" ] == "fixed"
112+
113+
114+ def test_configuration_direct_mode_deprecated (caplog ):
115+ """Test Configuration with deprecated 'direct' mode logs warning."""
116+ from mxdev .config import Configuration
117+
118+ base = pathlib .Path (__file__ ).parent / "data" / "config_samples"
119+ config = Configuration (str (base / "config_deprecated_direct.ini" ))
120+
121+ # Mode should be treated as 'editable' internally
122+ assert config .settings ["default-install-mode" ] == "editable"
123+ assert config .packages ["example.package" ]["install-mode" ] == "editable"
124+
125+ # Should have logged deprecation warning
126+ assert any (
127+ "install-mode 'direct' is deprecated" in record .message
128+ for record in caplog .records
129+ )
130+
131+
132+ def test_configuration_package_direct_mode_deprecated (caplog ):
133+ """Test per-package 'direct' mode logs deprecation warning."""
134+ from mxdev .config import Configuration
135+
136+ base = pathlib .Path (__file__ ).parent / "data" / "config_samples"
137+ config = Configuration (str (base / "config_package_direct.ini" ))
138+
139+ # Package mode should be treated as 'editable' internally
140+ assert config .packages ["example.package" ]["install-mode" ] == "editable"
141+
142+ # Should have logged deprecation warning
143+ assert any (
144+ "install-mode 'direct' is deprecated" in record .message
145+ for record in caplog .records
146+ )
147+
148+
92149def test_configuration_invalid_default_install_mode ():
93150 """Test Configuration with invalid default-install-mode."""
94151 from mxdev .config import Configuration
95152
96153 base = pathlib .Path (__file__ ).parent / "data" / "config_samples"
97- with pytest .raises (ValueError , match = "default-install-mode must be one of" ):
154+ with pytest .raises (
155+ ValueError ,
156+ match = r"default-install-mode must be one of 'editable', 'fixed', or 'skip'" ,
157+ ):
98158 Configuration (str (base / "config_invalid_mode.ini" ))
99159
100160
@@ -103,7 +163,10 @@ def test_configuration_invalid_package_install_mode():
103163 from mxdev .config import Configuration
104164
105165 base = pathlib .Path (__file__ ).parent / "data" / "config_samples"
106- with pytest .raises (ValueError , match = "install-mode in .* must be one of" ):
166+ with pytest .raises (
167+ ValueError ,
168+ match = r"install-mode in .* must be one of 'editable', 'fixed', or 'skip'" ,
169+ ):
107170 Configuration (str (base / "config_package_invalid_mode.ini" ))
108171
109172
@@ -182,7 +245,7 @@ def test_configuration_package_defaults():
182245 assert pkg ["extras" ] == ""
183246 assert pkg ["subdirectory" ] == ""
184247 assert pkg ["target" ] == "sources" # default-target not set, should be "sources"
185- assert pkg ["install-mode" ] == "direct " # default mode
248+ assert pkg ["install-mode" ] == "editable " # default mode changed from 'direct'
186249 assert pkg ["vcs" ] == "git"
187250 assert "path" in pkg
188251
0 commit comments