Example #1
0
    def _test_one_line(self):
        from py4j.protocol import Py4JJavaError

        job = MRSparKaboom(['-r', 'inline'])
        job.sandbox(stdin=BytesIO(b'line\n'))

        with job.make_runner() as runner:
            self.assertRaises(Py4JJavaError, runner.run)
Example #2
0
    def test_spark_job_failure(self):
        job = MRSparKaboom(['-r', 'inline'])
        job.sandbox(stdin=BytesIO(b'line\n'))

        from py4j.protocol import Py4JJavaError

        with job.make_runner() as runner:
            self.assertRaises(Py4JJavaError, runner.run)
Example #3
0
    def test_spark_job_failure(self):
        job = MRSparKaboom(['-r', 'inline'])
        job.sandbox(stdin=BytesIO(b'line\n'))

        from py4j.protocol import Py4JJavaError

        with job.make_runner() as runner:
            self.assertRaises(Py4JJavaError, runner.run)
Example #4
0
    def test_empty(self):
        # no lines means no KABOOM
        job = MRSparKaboom([])
        job.sandbox()

        with job.make_runner() as runner:
            runner.run()

            self.assertEqual(sorted(to_lines(runner.cat_output())), [])
Example #5
0
    def test_spark_job_failure(self):
        job = MRSparKaboom(['-r', 'spark'])
        job.sandbox(stdin=BytesIO(b'line\n'))

        with job.make_runner() as runner:
            self.assertRaises(StepFailedException, runner.run)
Example #6
0
    def test_spark_job_failure(self):
        job = MRSparKaboom(['-r', 'local'])
        job.sandbox(stdin=BytesIO(b'line\n'))

        with job.make_runner() as runner:
            self.assertRaises(StepFailedException, runner.run)