Skip to content

Commit 77b46b3

Browse files
committed
Add test
1 parent a87e1d6 commit 77b46b3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/configuration/test_configuration.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,22 @@ def test_activate_additional_environments():
215215
assert "part-2" in str(zc)
216216

217217

218-
def test_activate_default_environment():
218+
def test_activate_default_environment_from_config_file():
219219
zc = zocalo.configuration.from_string(sample_configuration)
220220
e = zc.activate([])
221221
assert e == ("default",)
222222
assert zc.active_environments == ("default",)
223223
assert "default" in str(zc)
224224

225225

226+
def test_activate_default_environment_from_environment_variable():
227+
with mock.patch.dict(os.environ, {"ZOCALO_DEFAULT_ENV": "partial"}):
228+
zc = zocalo.configuration.from_string(sample_configuration)
229+
e = zc.activate([])
230+
assert e == ("partial",)
231+
assert zc.active_environments == ("partial",)
232+
233+
226234
def test_activate_call_honours_default_flag():
227235
zc = zocalo.configuration.from_string(sample_configuration)
228236
e = zc.activate([], default=False)

0 commit comments

Comments
 (0)