1
- from shared .rollouts .features import USE_NEW_MINIO
1
+ from shared .rollouts .features import USE_MINIO , USE_NEW_MINIO
2
2
from shared .storage import get_appropriate_storage_service
3
3
from shared .storage .aws import AWSStorageService
4
4
from shared .storage .fallback import StorageWithFallbackService
@@ -123,6 +123,37 @@ def test_get_appropriate_storage_service_new_minio(
123
123
"minio" : minio_config ,
124
124
}
125
125
mocker .patch .object (USE_NEW_MINIO , "check_value" , return_value = True )
126
+ mocker .patch .object (USE_MINIO , "check_value" , return_value = False )
127
+ res = get_appropriate_storage_service (repoid = 123 )
128
+ assert isinstance (res , NewMinioStorageService )
129
+ assert res .minio_config == minio_config
130
+
131
+ def test_get_appropriate_storage_service_use_minio (
132
+ self , mock_configuration , mocker
133
+ ):
134
+ mock_configuration .params ["services" ] = {
135
+ "chosen_storage" : "minio" ,
136
+ "gcp" : gcp_config ,
137
+ "aws" : aws_config ,
138
+ "minio" : minio_config ,
139
+ }
140
+ mocker .patch .object (USE_MINIO , "check_value" , return_value = True )
141
+ mocker .patch .object (USE_NEW_MINIO , "check_value" , return_value = False )
142
+ res = get_appropriate_storage_service (repoid = 123 )
143
+ assert isinstance (res , MinioStorageService )
144
+ assert res .minio_config == minio_config
145
+
146
+ def test_get_appropriate_storage_service_use_minio_and_new_minio (
147
+ self , mock_configuration , mocker
148
+ ):
149
+ mock_configuration .params ["services" ] = {
150
+ "chosen_storage" : "minio" ,
151
+ "gcp" : gcp_config ,
152
+ "aws" : aws_config ,
153
+ "minio" : minio_config ,
154
+ }
155
+ mocker .patch .object (USE_MINIO , "check_value" , return_value = True )
156
+ mocker .patch .object (USE_NEW_MINIO , "check_value" , return_value = True )
126
157
res = get_appropriate_storage_service (repoid = 123 )
127
158
assert isinstance (res , NewMinioStorageService )
128
159
assert res .minio_config == minio_config
@@ -137,6 +168,7 @@ def test_get_appropriate_storage_service_new_minio_false(
137
168
"minio" : minio_config ,
138
169
}
139
170
mocker .patch .object (USE_NEW_MINIO , "check_value" , return_value = False )
171
+ mocker .patch .object (USE_MINIO , "check_value" , return_value = False )
140
172
res = get_appropriate_storage_service (repoid = 123 )
141
173
assert isinstance (res , MinioStorageService )
142
174
assert res .minio_config == minio_config
@@ -152,6 +184,7 @@ def test_get_appropriate_storage_service_new_minio_cached(
152
184
}
153
185
154
186
mocker .patch .object (USE_NEW_MINIO , "check_value" , return_value = False )
187
+ mocker .patch .object (USE_MINIO , "check_value" , return_value = False )
155
188
156
189
res = get_appropriate_storage_service (repoid = 123 )
157
190
0 commit comments