def expect_failure_because_specified_file_under_sds_is_missing( self, symbol_usages: Assertion[ Sequence[SymbolUsage]] = asrt.is_empty_sequence, ): return Expectation(main_result=asrt_sh.is_hard_error(), symbol_usages=symbol_usages)
def expect_failing_validation_post_setup( self, assertion_on_error_message: Assertion[str] = asrt.anything_goes(), symbol_usages: Assertion[Sequence[SymbolUsage]] = asrt.is_empty_sequence, ): return Expectation( main_result=asrt_sh.is_hard_error( asrt_text_doc.is_string_for_test(assertion_on_error_message) ), symbol_usages=symbol_usages, )
def expect_failing_validation_pre_sds( self, error_message: Assertion[TextRenderer] = asrt_text_doc.is_any_text(), symbol_usages: Assertion[ Sequence[SymbolUsage]] = asrt.is_empty_sequence, ): return Expectation( validate_pre_sds_result=svh_assertions.is_validation_error( error_message), symbol_usages=symbol_usages, )
def expect_failure_of_main( self, assertion_on_error_message: Assertion[TextRenderer] = asrt_text_doc. is_any_text(), symbol_usages: Assertion[ Sequence[SymbolUsage]] = asrt.is_empty_sequence, ): return Expectation( main_result=asrt_sh.is_hard_error(assertion_on_error_message), symbol_usages=symbol_usages, )
def expect_success( self, main_side_effects_on_sds: Assertion = asrt.anything_goes(), symbol_usages: Assertion = asrt.is_empty_sequence, source: Assertion[ParseSource] = asrt.anything_goes(), proc_exe_settings: Assertion[ProcessExecutionSettings] = asrt. is_instance(ProcessExecutionSettings), instruction_settings: Assertion[InstructionSettings] = asrt. is_instance(InstructionSettings), ): return Expectation( source=source, symbol_usages=symbol_usages, main_side_effects_on_sds=main_side_effects_on_sds, proc_exe_settings=proc_exe_settings, instruction_settings=instruction_settings, )
def expectation_for_zero_exitcode(self) -> Expectation: return Expectation()
def expectation_for_non_zero_exitcode(self) -> Expectation: return Expectation(main_result=asrt_sh.is_hard_error())
def expect_target_is_not_a_directory(self): return Expectation(main_result=asrt_sh.is_hard_error())
def expect_successful_execution_with_side_effect( self, side_effects_check: Assertion, symbol_usages: Assertion = asrt.is_empty_sequence): return Expectation(main_side_effects_on_tcds=side_effects_check, symbol_usages=symbol_usages)
def expect_failure_to_create_dir( self, symbol_usages: Assertion = asrt.is_empty_sequence): return Expectation(main_result=asrt_sh.is_hard_error(), symbol_usages=symbol_usages)
def expect_hard_error_in_main(self) -> Expectation: return Expectation(main_result=asrt_sh.is_hard_error())
def expectation_for_zero_exitcode(self) -> Expectation: return Expectation(main_result=asrt_sh.is_success())