9
9
import pytest
10
10
11
11
import openeo_driver .config .load
12
- from openeo_driver .config import ConfigException , OpenEoBackendConfig , get_backend_config , from_env , from_env_list
12
+ from openeo_driver .config import ConfigException , OpenEoBackendConfig , get_backend_config , from_env , from_env_as_list
13
13
from openeo_driver .config .load import load_from_py_file
14
14
import openeo_driver .config .env
15
15
from .conftest import enhanced_logging
@@ -192,7 +192,7 @@ def test_to_list(self):
192
192
def test_from_env_list_basic (self , monkeypatch ):
193
193
@attrs .frozen (kw_only = True )
194
194
class Config :
195
- colors : List [str ] = attrs .field (factory = from_env_list ("COLORS" , default = "red,blue" ))
195
+ colors : List [str ] = attrs .field (factory = from_env_as_list ("COLORS" , default = "red,blue" ))
196
196
197
197
conf = Config ()
198
198
assert conf .colors == ["red" , "blue" ]
@@ -220,7 +220,7 @@ class Config:
220
220
def test_from_env_list_splitting (self , monkeypatch , default , env_value , expected_from_default , expected_from_env ):
221
221
@attrs .frozen (kw_only = True )
222
222
class Config :
223
- colors : List [str ] = attrs .Factory (from_env_list ("COLORS" , default = default ))
223
+ colors : List [str ] = attrs .Factory (from_env_as_list ("COLORS" , default = default ))
224
224
225
225
assert Config ().colors == expected_from_default
226
226
@@ -242,7 +242,7 @@ class Config:
242
242
def test_from_env_list_strip (self , monkeypatch , env_value , strip , expected ):
243
243
@attrs .frozen (kw_only = True )
244
244
class Config :
245
- colors : List [str ] = attrs .Factory (from_env_list ("COLORS" , default = "red,blue" , strip = strip ))
245
+ colors : List [str ] = attrs .Factory (from_env_as_list ("COLORS" , default = "red,blue" , strip = strip ))
246
246
247
247
monkeypatch .setenv ("COLORS" , env_value )
248
248
@@ -260,7 +260,7 @@ class Config:
260
260
def test_from_env_list_separator (self , monkeypatch , default , separator ):
261
261
@attrs .frozen (kw_only = True )
262
262
class Config :
263
- colors : List [str ] = attrs .Factory (from_env_list ("COLORS" , default = default , separator = separator ))
263
+ colors : List [str ] = attrs .Factory (from_env_as_list ("COLORS" , default = default , separator = separator ))
264
264
265
265
assert Config ().colors == ["red" , "blue" ]
266
266
@@ -269,6 +269,6 @@ def test_from_env_list_default_as_list(self, monkeypatch):
269
269
270
270
@attrs .frozen (kw_only = True )
271
271
class Config :
272
- colors : List [str ] = attrs .Factory (from_env_list ("COLORS" , default = ["red" , "blue" ]))
272
+ colors : List [str ] = attrs .Factory (from_env_as_list ("COLORS" , default = ["red" , "blue" ]))
273
273
274
274
assert Config ().colors == ["red" , "blue" ]
0 commit comments