Пример #1
0
 def test_glue_param_error(self):
     g = GlueJob('example/glue_jobs/simple_etl_job/',
                 bucket='alpha-everyone',
                 job_role='alpha_user_isichei',
                 job_arguments={'--test_arg': 'this is a test'})
     with self.assertRaises(ValueError):
         g.job_arguments = '--bad_job_argument1'
     with self.assertRaises(ValueError):
         g.job_arguments = {'bad_job_argument2': 'test'}
     with self.assertRaises(ValueError):
         g.job_arguments = {"--JOB_NAME": "new_job_name"}
Пример #2
0
 def test_glue_param_error(self):
     g = GlueJob(
         "example/glue_jobs/simple_etl_job/",
         bucket="alpha-everyone",
         job_role="alpha_user_isichei",
         job_arguments={"--test_arg": "this is a test"},
     )
     with self.assertRaises(ValueError):
         g.job_arguments = "--bad_job_argument1"
     with self.assertRaises(ValueError):
         g.job_arguments = {"bad_job_argument2": "test"}
     with self.assertRaises(ValueError):
         g.job_arguments = {"--JOB_NAME": "new_job_name"}
Пример #3
0
    def test_db_value_properties(self):
        g = GlueJob('example/glue_jobs/simple_etl_job/',
                    bucket='alpha-everyone',
                    job_role='alpha_user_isichei',
                    job_arguments={'--test_arg': 'this is a test'})

        g.job_name = 'changed_job_name'
        self.assertEqual(g.job_name, 'changed_job_name')

        g.bucket = "new-bucket"
        self.assertEqual(g.bucket, "new-bucket")
        with self.assertRaises(ValueError):
            g.bucket = "s3://new-bucket"

        g.job_role = 'alpha_new_user'
        self.assertEqual(g.job_role, 'alpha_new_user')

        g.job_arguments = {"--new_args": "something"}
        self.assertEqual(g.job_arguments["--new_args"], "something")
Пример #4
0
    def test_db_value_properties(self):
        g = GlueJob(
            "example/glue_jobs/simple_etl_job/",
            bucket="alpha-everyone",
            job_role="alpha_user_isichei",
            job_arguments={"--test_arg": "this is a test"},
        )

        g.job_name = "changed_job_name"
        self.assertEqual(g.job_name, "changed_job_name")

        g.bucket = "new-bucket"
        self.assertEqual(g.bucket, "new-bucket")
        with self.assertRaises(ValueError):
            g.bucket = "s3://new-bucket"

        g.job_role = "alpha_new_user"
        self.assertEqual(g.job_role, "alpha_new_user")

        g.job_arguments = {"--new_args": "something"}
        self.assertEqual(g.job_arguments["--new_args"], "something")