@@ -178,7 +178,7 @@ def test_managed_bucket_patterns(self, collection_name):
178178 default environment explicitly here.
179179 This might appear a bit artificial, but otherwise we have no way
180180 to machine-test the functioning of getting the values from the env
181- list, use them as regex, and match the collection name.
181+ list and match the collection name.
182182 """
183183 env = environ .Env ()
184184 env .read_env ("../.local.default" )
@@ -188,3 +188,22 @@ def test_managed_bucket_patterns(self, collection_name):
188188 bucket_name = select_s3_bucket (collection_name )
189189
190190 self .assertEqual (bucket_name , AVAILABLE_S3_BUCKETS .managed )
191+
192+ @parameterized .expand ([
193+ 'ch.meteoschweiz.ogd-precipitation' ,
194+ ])
195+ def test_managed_bucket_patterns_blacklist (self , collection_name ):
196+ """Test if the patterns in the environment work correctly. We take the
197+ default environment explicitly here.
198+ This might appear a bit artificial, but otherwise we have no way
199+ to machine-test the functioning of getting the values from the env
200+ list and match the collection name.
201+ """
202+ env = environ .Env ()
203+ env .read_env ("../.local.default" )
204+
205+ patterns = env .list ('MANAGED_BUCKET_COLLECTION_PATTERNS_BLACKLIST' )
206+ with self .settings (MANAGED_BUCKET_COLLECTION_PATTERNS = patterns ):
207+ bucket_name = select_s3_bucket (collection_name )
208+
209+ self .assertEqual (bucket_name , AVAILABLE_S3_BUCKETS .legacy )
0 commit comments