Get standalone server mode working for all tests.

This commit is contained in:
Steve Pulec 2017-02-23 19:43:48 -05:00
commit 81836b6981
78 changed files with 957 additions and 783 deletions

View file

@ -112,7 +112,7 @@ def test_describe_jobflows():
args = run_jobflow_args.copy()
expected = {}
for idx in range(400):
for idx in range(4):
cluster_name = 'cluster' + str(idx)
args['name'] = cluster_name
cluster_id = conn.run_jobflow(**args)
@ -128,7 +128,7 @@ def test_describe_jobflows():
timestamp = datetime.now(pytz.utc)
time.sleep(1)
for idx in range(400, 600):
for idx in range(4, 6):
cluster_name = 'cluster' + str(idx)
args['name'] = cluster_name
cluster_id = conn.run_jobflow(**args)
@ -139,7 +139,7 @@ def test_describe_jobflows():
'state': 'TERMINATED'
}
jobs = conn.describe_jobflows()
jobs.should.have.length_of(512)
jobs.should.have.length_of(6)
for cluster_id, y in expected.items():
resp = conn.describe_jobflows(jobflow_ids=[cluster_id])
@ -147,15 +147,15 @@ def test_describe_jobflows():
resp[0].jobflowid.should.equal(cluster_id)
resp = conn.describe_jobflows(states=['WAITING'])
resp.should.have.length_of(400)
resp.should.have.length_of(4)
for x in resp:
x.state.should.equal('WAITING')
resp = conn.describe_jobflows(created_before=timestamp)
resp.should.have.length_of(400)
resp.should.have.length_of(4)
resp = conn.describe_jobflows(created_after=timestamp)
resp.should.have.length_of(200)
resp.should.have.length_of(2)
@mock_emr_deprecated

View file

@ -128,7 +128,7 @@ def test_describe_job_flows():
args = deepcopy(run_job_flow_args)
expected = {}
for idx in range(400):
for idx in range(4):
cluster_name = 'cluster' + str(idx)
args['Name'] = cluster_name
cluster_id = client.run_job_flow(**args)['JobFlowId']
@ -144,7 +144,7 @@ def test_describe_job_flows():
timestamp = datetime.now(pytz.utc)
time.sleep(1)
for idx in range(400, 600):
for idx in range(4, 6):
cluster_name = 'cluster' + str(idx)
args['Name'] = cluster_name
cluster_id = client.run_job_flow(**args)['JobFlowId']
@ -156,7 +156,7 @@ def test_describe_job_flows():
}
resp = client.describe_job_flows()
resp['JobFlows'].should.have.length_of(512)
resp['JobFlows'].should.have.length_of(6)
for cluster_id, y in expected.items():
resp = client.describe_job_flows(JobFlowIds=[cluster_id])
@ -164,15 +164,15 @@ def test_describe_job_flows():
resp['JobFlows'][0]['JobFlowId'].should.equal(cluster_id)
resp = client.describe_job_flows(JobFlowStates=['WAITING'])
resp['JobFlows'].should.have.length_of(400)
resp['JobFlows'].should.have.length_of(4)
for x in resp['JobFlows']:
x['ExecutionStatusDetail']['State'].should.equal('WAITING')
resp = client.describe_job_flows(CreatedBefore=timestamp)
resp['JobFlows'].should.have.length_of(400)
resp['JobFlows'].should.have.length_of(4)
resp = client.describe_job_flows(CreatedAfter=timestamp)
resp['JobFlows'].should.have.length_of(200)
resp['JobFlows'].should.have.length_of(2)
@mock_emr
@ -327,13 +327,13 @@ def test_run_job_flow():
@mock_emr
def test_run_job_flow_with_invalid_params():
client = boto3.client('emr', region_name='us-east-1')
with assert_raises(ClientError) as e:
with assert_raises(ClientError) as ex:
# cannot set both AmiVersion and ReleaseLabel
args = deepcopy(run_job_flow_args)
args['AmiVersion'] = '2.4'
args['ReleaseLabel'] = 'emr-5.0.0'
client.run_job_flow(**args)
e.exception.response['Error']['Code'].should.equal('ValidationException')
ex.exception.response['Error']['Message'].should.contain('ValidationException')
@mock_emr