def test_with_all_job_flows(self): self.mock_emr_job_flows.update(JOB_FLOWS_BY_ID) emr_conn = EMRJobRunner(conf_paths=[]).make_emr_conn() emr_conn.run_jobflow('no name', log_uri=None) main(['-q', '--no-conf']) lines = [line for line in StringIO(self.stdout.getvalue())] self.assertEqual(len(lines), len(JOB_FLOWS_BY_ID) - 1)
def test_exclude(self): for cluster in CLUSTERS: self.add_mock_emr_cluster(cluster) main(['-q', '--no-conf', '-x', 'my_key,my_value']) lines = [line for line in StringIO(self.stdout.getvalue())] self.assertEqual(len(lines), len(CLUSTERS_BY_ID) - 2) self.assertNotIn('j-COMPLETED', self.stdout.getvalue()) self.assertNotIn('j-RUNNING1STEP', self.stdout.getvalue())
def test_with_all_clusters(self): for cluster in CLUSTERS: self.add_mock_emr_cluster(cluster) emr_conn = self.connect_emr() emr_conn.run_jobflow('no name', job_flow_role='fake-instance-profile', service_role='fake-service-role') main(['-q', '--no-conf']) lines = [line for line in StringIO(self.stdout.getvalue())] self.assertEqual(len(lines), len(CLUSTERS_BY_ID) - 1)
def test_with_all_clusters(self): for cluster in CLUSTERS: self.add_mock_emr_cluster(cluster) emr_client = self.client('emr') emr_client.run_job_flow( Name='no name', Instances=dict( MasterInstanceType='m1.medium', InstanceCount=1, ), JobFlowRole='fake-instance-profile', ReleaseLabel='emr-4.0.0', ServiceRole='fake-service-role', ) main(['-q', '--no-conf']) lines = [line for line in StringIO(self.stdout.getvalue())] self.assertEqual(len(lines), len(CLUSTERS_BY_ID) - 1)
def test_with_all_clusters(self): for cluster in CLUSTERS: self.add_mock_emr_cluster(cluster) emr_client = self.client('emr') emr_client.run_job_flow( Name='no name', Instances=dict( MasterInstanceType='m1.medium', InstanceCount=1, ), JobFlowRole='fake-instance-profile', ReleaseLabel='emr-4.0.0', ServiceRole='fake-service-role', ) main(['-q', '--no-conf']) lines = [line for line in StringIO(self.stdout.getvalue())] self.assertEqual(len(lines), len(CLUSTERS_BY_ID) - 1) self.assertNotIn('j-COMPLETED', self.stdout.getvalue())
def test_with_no_job_flows(self): main(['-q', '--no-conf']) # just make sure it doesn't crash
def test_with_no_clusters(self): main(['-q', '--no-conf']) # just make sure it doesn't crash
def test_with_no_job_flows(self): main(["-q", "--no-conf"]) # just make sure it doesn't crash
def test_with_one_job_flow(self): emr_conn = EMRJobRunner(conf_path=False).make_emr_conn() emr_conn.run_jobflow('no name', log_uri=None) main(['-q', '--no-conf']) # just make sure it doesn't crash