예제 #1
0
    def test_on_kill(self, mock_kill, mock_rul_cli):
        operator = PigOperator(pig=PIG, task_id=TEST_TASK_ID)
        operator.execute(context=TEST_CONTEXT_ID)
        operator.on_kill()

        mock_rul_cli.assert_called()
        mock_kill.assert_called()
예제 #2
0
    def test_execute(self, mock_run_cli):
        pig_opts = "-x mapreduce"
        operator = PigOperator(pig=PIG,
                               pig_opts=pig_opts,
                               task_id=TEST_TASK_ID)
        operator.execute(context=TEST_CONTEXT_ID)

        mock_run_cli.assert_called_once_with(pig=PIG, pig_opts=pig_opts)
예제 #3
0
    def test_execute_default_pig_opts_to_none(self, mock_run_cli):
        operator = PigOperator(pig=PIG, task_id=TEST_TASK_ID)
        operator.execute(context=TEST_CONTEXT_ID)

        mock_run_cli.assert_called_once_with(pig=PIG, pig_opts=None)