def check_actor_execution(put: unittest.TestCase, arrangement: Arrangement, expectation: Expectation): instruction = sut.Parser().parse(ARBITRARY_FS_LOCATION_INFO, arrangement.source) configuration_builder = _configuration_builder_with_exception_throwing_act_phase_setup() assert isinstance(instruction, ConfigurationPhaseInstruction) instruction.main(configuration_builder) act_phase_instructions = [instr(arrangement.act_phase_source_lines)] integration_check.check_execution( put, configuration_builder.actor.value, act_phase_instructions, integration_check.arrangement_w_tcds( hds_contents=arrangement.hds_contents, process_execution=ProcessExecutionArrangement( os_services=arrangement.os_services, )), integration_check.Expectation( symbol_usages=expectation.symbol_usages, post_sds=PostSdsExpectation.constant( sub_process_result_from_execute=expectation.sub_process_result_from_execute ), after_execution=expectation.after_execution ) ) expectation.source_after_parse.apply_with_message(put, arrangement.source, 'source after parse')
def test_fail_when_missing_program_argument(self): source = source4(actor_utils.SOURCE_INTERPRETER_NAME) with self.assertRaises(SingleInstructionInvalidArgumentException): sut.Parser().parse(ARBITRARY_FS_LOCATION_INFO, source)
def test_fail_when_extra_unexpected_argument(self): source = source4(actor_utils.COMMAND_LINE_ACTOR_NAME + ' extra-unexpected-argument') with self.assertRaises(SingleInstructionInvalidArgumentException): sut.Parser().parse(ARBITRARY_FS_LOCATION_INFO, source)
def test_fail_when_the_quoting_is_invalid(self): source = source4('argument-1 "argument-2') with self.assertRaises(SingleInstructionInvalidArgumentException): sut.Parser().parse(ARBITRARY_FS_LOCATION_INFO, source)
def test_fail_when_missing_arg_to_eq_token(self): source = source4(' = ') with self.assertRaises(SingleInstructionInvalidArgumentException): sut.Parser().parse(ARBITRARY_FS_LOCATION_INFO, source)
def test_fail_when_there_is_no_arguments(self): source = source4(' ') with self.assertRaises(SingleInstructionInvalidArgumentException): sut.Parser().parse(ARBITRARY_FS_LOCATION_INFO, source)
def test_superfluous_arguments(self): source = remaining_source('= {} superfluous'.format( actor_utils.NULL_ACTOR_NAME)) with self.assertRaises(SingleInstructionInvalidArgumentException): sut.Parser().parse(ARBITRARY_FS_LOCATION_INFO, source)