def boto_volume_for_test(test, cluster_id):
 region_name = u'some-test-region-1'
 s = Boto3Session(botocore_session=botocore_get_session(), region_name=region_name)
 ec2 = s.resource('ec2', region_name=region_name)
 stubber = Stubber(ec2.meta.client)
 stubber.activate()
 volume_id = u'vol-{}'.format(random_name(test))
 v = ec2.Volume(id=volume_id)
 tags = []
 if (cluster_id is not None):
  tags.append(dict(Key=CLUSTER_ID_LABEL, Value=cluster_id))
 v.meta.data = dict(Tags=tags)
 return v

def boto_volume_for_test ( test , cluster_id ) : region_name = u'some-test-region-1' s = Boto3Session ( botocore_session = botocore_get_session ( ) , region_name = region_name ) ec2 = s . resource ( 'ec2' , region_name = region_name ) stubber = Stubber ( ec2 . meta . client ) stubber . activate ( ) volume_id = u'vol-{}' . format ( random_name ( test ) ) v = ec2 . Volume ( id = volume_id ) tags = [ ] if ( cluster_id is not None ) : tags . append ( dict ( Key = CLUSTER_ID_LABEL , Value = cluster_id ) ) v . meta . data = dict ( Tags = tags ) return v
create an in-memory boto3 volume .