<s> """<STR_LIT>""" <EOL> import unittest <EOL> from perfkitbenchmarker import errors <EOL> from perfkitbenchmarker . providers . aws import aws_disk <EOL> from tests import mock_flags <EOL> _COMPONENT = '<STR_LIT>' <EOL> class AwsDiskSpecTestCase ( unittest . TestCase ) : <EOL> def testDefaults ( self ) : <EOL> spec = aws_disk . AwsDiskSpec ( _COMPONENT ) <EOL> self . assertIsNone ( spec . device_path ) <EOL> self . assertIsNone ( spec . disk_number ) <EOL> self . assertIsNone ( spec . disk_size ) <EOL> self . assertIsNone ( spec . disk_type ) <EOL> self . assertIsNone ( spec . iops ) <EOL> self . assertIsNone ( spec . mount_point ) <EOL> self . assertEqual ( spec . num_striped_disks , <NUM_LIT:1> ) <EOL> def testProvidedValid ( self ) : <EOL> spec = aws_disk . AwsDiskSpec ( <EOL> _COMPONENT , device_path = '<STR_LIT>' , disk_number = <NUM_LIT:1> , <EOL> disk_size = <NUM_LIT> , disk_type = '<STR_LIT>' , iops = <NUM_LIT:1000> , <EOL> mount_point = '<STR_LIT>' , num_striped_disks = <NUM_LIT:2> ) <EOL> self . assertEqual ( spec . device_path , '<STR_LIT>' ) <EOL> self . assertEqual ( spec . disk_number , <NUM_LIT:1> ) <EOL> self . assertEqual ( spec . disk_size , <NUM_LIT> ) <EOL> self . assertEqual ( spec . disk_type , '<STR_LIT>' ) <EOL> self . assertEqual ( spec . iops , <NUM_LIT:1000> ) <EOL> self . assertEqual ( spec . mount_point , '<STR_LIT>' ) <EOL> self . assertEqual ( spec . num_striped_disks , <NUM_LIT:2> ) <EOL> def testProvidedNone ( self ) : <EOL> spec = aws_disk . AwsDiskSpec ( _COMPONENT , iops = None ) <EOL> self . assertIsNone ( spec . iops ) <EOL> def testInvalidOptionTypes ( self ) : <EOL> with self . assertRaises ( errors . Config . InvalidValue ) : <EOL> aws_disk . AwsDiskSpec ( _COMPONENT , iops = '<STR_LIT>' ) <EOL> def testNonPresentFlagsDoNotOverrideConfigs ( self ) : <EOL> flags = mock_flags . MockFlags ( ) <EOL> flags [ '<STR_LIT>' ] . value = <NUM_LIT> <EOL> flags [ '<STR_LIT>' ] . value = <NUM_LIT:100> <EOL> spec = aws_disk . AwsDiskSpec ( _COMPONENT , flags , disk_size = <NUM_LIT> , iops = <NUM_LIT:1000> ) <EOL> self . assertEqual ( spec . disk_size , <NUM_LIT> ) <EOL> self . assertEqual ( spec . iops , <NUM_LIT:1000> ) <EOL> def testPresentFlagsOverrideConfigs ( self ) : <EOL> flags = mock_flags . MockFlags ( ) <EOL> flags [ '<STR_LIT>' ] . Parse ( <NUM_LIT> ) <EOL> flags [ '<STR_LIT>' ] . Parse ( <NUM_LIT:100> ) <EOL> spec = aws_disk . AwsDiskSpec ( _COMPONENT , flags , disk_size = <NUM_LIT> , iops = <NUM_LIT:1000> ) <EOL> self . assertEqual ( spec . disk_size , <NUM_LIT:100> ) <EOL> self . assertEqual ( spec . iops , <NUM_LIT> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
