#2784 Implementing assertions for testcase with instance groups
This commit is contained in:
parent
c8dfbe9575
commit
23771549c2
@ -438,6 +438,19 @@ def test_run_job_flow_with_visible_to_all_users():
|
||||
resp = client.describe_cluster(ClusterId=cluster_id)
|
||||
resp["Cluster"]["VisibleToAllUsers"].should.equal(expected)
|
||||
|
||||
def _do_assertion_ebs_configuration(x, y):
|
||||
total_volumes = 0
|
||||
total_size = 0
|
||||
for ebs_block in y["EbsConfiguration"]["EbsBlockDeviceConfigs"]:
|
||||
total_volumes += ebs_block["VolumesPerInstance"]
|
||||
total_size += ebs_block["VolumeSpecification"]["SizeInGB"]
|
||||
# Multiply by total volumes
|
||||
total_size = total_size * total_volumes
|
||||
comp_total_size = 0
|
||||
for ebs_block in x["EbsBlockDevices"]:
|
||||
comp_total_size += ebs_block["VolumeSpecification"]["SizeInGB"]
|
||||
len(x["EbsBlockDevices"]).should.equal(total_volumes)
|
||||
comp_total_size.should.equal(comp_total_size)
|
||||
|
||||
@mock_emr
|
||||
def test_run_job_flow_with_instance_groups():
|
||||
@ -456,8 +469,9 @@ def test_run_job_flow_with_instance_groups():
|
||||
x["Market"].should.equal(y["Market"])
|
||||
if "BidPrice" in y:
|
||||
x["BidPrice"].should.equal(y["BidPrice"])
|
||||
|
||||
if "EbsConfiguration" in y:
|
||||
x["EbsConfiguration"].should.equal(y["EbsConfiguration"])
|
||||
_do_assertion_ebs_configuration(x, y)
|
||||
|
||||
|
||||
@mock_emr
|
||||
@ -635,18 +649,7 @@ def test_instance_groups():
|
||||
if hasattr(y, "BidPrice"):
|
||||
x["BidPrice"].should.equal("BidPrice")
|
||||
if "EbsConfiguration" in y:
|
||||
total_volumes = 0
|
||||
total_size = 0
|
||||
for ebs_block in y["EbsConfiguration"]["EbsBlockDeviceConfigs"]:
|
||||
total_volumes += ebs_block["VolumesPerInstance"]
|
||||
total_size += ebs_block["VolumeSpecification"]["SizeInGB"]
|
||||
# Multiply by total volumes
|
||||
total_size = total_size * total_volumes
|
||||
comp_total_size = 0
|
||||
for ebs_block in x["EbsBlockDevices"]:
|
||||
comp_total_size += ebs_block["VolumeSpecification"]["SizeInGB"]
|
||||
len(x["EbsBlockDevices"]).should.equal(total_volumes)
|
||||
comp_total_size.should.equal(comp_total_size)
|
||||
_do_assertion_ebs_configuration(x, y)
|
||||
# Configurations
|
||||
# EbsBlockDevices
|
||||
# EbsOptimized
|
||||
|
Loading…
Reference in New Issue
Block a user