@@ -103,6 +103,12 @@ def test_set_preferred_transfer_client(self, provided, resolved):
103
103
('target_bandwidth' , '1000' , 1000 ),
104
104
('target_bandwidth' , '1000B/s' , 1000 ),
105
105
('target_bandwidth' , '8000b/s' , 1000 ),
106
+ # disk_throughput cases
107
+ ('disk_throughput' , '1MB/s' , 1024 * 1024 ),
108
+ ('disk_throughput' , '10Mb/s' , 10 * 1024 * 1024 / 8 ),
109
+ ('disk_throughput' , '1000' , 1000 ),
110
+ ('disk_throughput' , '1000B/s' , 1000 ),
111
+ ('disk_throughput' , '8000b/s' , 1000 ),
106
112
],
107
113
)
108
114
def test_rate_conversions (self , config_name , provided , expected ):
@@ -127,6 +133,13 @@ def test_rate_conversions(self, config_name, provided, expected):
127
133
('target_bandwidth' , '100/s' ),
128
134
('target_bandwidth' , '' ),
129
135
('target_bandwidth' , 'value-with-no-digits' ),
136
+ # disk_throughput cases
137
+ ('disk_throughput' , '1MB' ),
138
+ ('disk_throughput' , '1B' ),
139
+ ('disk_throughput' , '1b' ),
140
+ ('disk_throughput' , '100/s' ),
141
+ ('disk_throughput' , '' ),
142
+ ('disk_throughput' , 'value-with-no-digits' ),
130
143
],
131
144
)
132
145
def test_invalid_rate_values (self , config_name , provided ):
@@ -138,6 +151,22 @@ def test_validates_preferred_transfer_client_choices(self):
138
151
with pytest .raises (transferconfig .InvalidConfigError ):
139
152
self .build_config_with (preferred_transfer_client = 'not-supported' )
140
153
154
+ @pytest .mark .parametrize (
155
+ 'attr,val,expected' ,
156
+ [
157
+ ('should_stream' , 'true' , True ),
158
+ ('should_stream' , 'false' , False ),
159
+ ('should_stream' , None , None ),
160
+ ('direct_io' , 'true' , True ),
161
+ ('direct_io' , 'false' , False ),
162
+ ('direct_io' , None , None ),
163
+ ],
164
+ )
165
+ def test_convert_booleans (self , attr , val , expected ):
166
+ params = {attr : val }
167
+ runtime_config = self .build_config_with (** params )
168
+ assert runtime_config [attr ] == expected
169
+
141
170
142
171
class TestConvertToS3TransferConfig :
143
172
def test_convert (self ):
0 commit comments