@@ -103,6 +103,12 @@ def test_set_preferred_transfer_client(self, provided, resolved):
103103 ('target_bandwidth' , '1000' , 1000 ),
104104 ('target_bandwidth' , '1000B/s' , 1000 ),
105105 ('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 ),
106112 ],
107113 )
108114 def test_rate_conversions (self , config_name , provided , expected ):
@@ -127,6 +133,13 @@ def test_rate_conversions(self, config_name, provided, expected):
127133 ('target_bandwidth' , '100/s' ),
128134 ('target_bandwidth' , '' ),
129135 ('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' ),
130143 ],
131144 )
132145 def test_invalid_rate_values (self , config_name , provided ):
@@ -138,6 +151,22 @@ def test_validates_preferred_transfer_client_choices(self):
138151 with pytest .raises (transferconfig .InvalidConfigError ):
139152 self .build_config_with (preferred_transfer_client = 'not-supported' )
140153
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+
141170
142171class TestConvertToS3TransferConfig :
143172 def test_convert (self ):
0 commit comments