<s> from awscli . testutils import unittest <EOL> from awscli . customizations . s3 import transferconfig <EOL> class TestTransferConfig ( unittest . TestCase ) : <EOL> def build_config_with ( self , ** config_from_user ) : <EOL> return transferconfig . RuntimeConfig ( ) . build_config ( ** config_from_user ) <EOL> def test_user_provides_no_config_uses_default ( self ) : <EOL> config = transferconfig . RuntimeConfig ( ) <EOL> runtime_config = config . build_config ( ) <EOL> self . assertEqual ( runtime_config , transferconfig . DEFAULTS ) <EOL> def test_user_provides_partial_overrides ( self ) : <EOL> config_from_user = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( <NUM_LIT:64> * ( <NUM_LIT> ** <NUM_LIT:2> ) ) , <EOL> } <EOL> runtime_config = self . build_config_with ( ** config_from_user ) <EOL> self . assertEqual ( runtime_config [ '<STR_LIT>' ] , <EOL> int ( config_from_user [ '<STR_LIT>' ] ) ) <EOL> self . assertEqual ( runtime_config [ '<STR_LIT>' ] , <EOL> int ( config_from_user [ '<STR_LIT>' ] ) ) <EOL> self . assertEqual ( runtime_config [ '<STR_LIT>' ] , <EOL> int ( transferconfig . DEFAULTS [ '<STR_LIT>' ] ) ) <EOL> def test_validates_integer_types ( self ) : <EOL> with self . assertRaises ( transferconfig . InvalidConfigError ) : <EOL> self . build_config_with ( max_concurrent_requests = "<STR_LIT>" ) <EOL> def test_validates_positive_integers ( self ) : <EOL> with self . assertRaises ( transferconfig . InvalidConfigError ) : <EOL> self . build_config_with ( max_concurrent_requests = "<STR_LIT>" ) <EOL> def test_min_value ( self ) : <EOL> with self . assertRaises ( transferconfig . InvalidConfigError ) : <EOL> self . build_config_with ( max_concurrent_requests = "<STR_LIT:0>" ) <EOL> def test_human_readable_sizes_converted_to_bytes ( self ) : <EOL> runtime_config = self . build_config_with ( multipart_threshold = "<STR_LIT>" ) <EOL> self . assertEqual ( runtime_config [ '<STR_LIT>' ] , <EOL> <NUM_LIT:10> * <NUM_LIT> * <NUM_LIT> ) </s>
