コード例 #1
0
 def __init__(
     self,
     validation: ValidationExpectationSvh = ValidationExpectationSvh.passes(
     ),
     main_result: Assertion[
         sh.SuccessOrHardError] = sh_assertions.is_success(),
     symbols_after_parse: Assertion[
         Sequence[SymbolUsage]] = asrt.is_empty_sequence,
     main_side_effects_on_sds: Assertion[SandboxDs] = asrt.anything_goes(),
     main_side_effects_on_tcds: Assertion[TestCaseDs] = asrt.anything_goes(
     ),
     settings_builder: Assertion[
         SettingsBuilderAssertionModel] = asrt_settings.
     stdin_is_not_present(),
     symbols_after_main: Assertion[
         Sequence[SymbolUsage]] = asrt.anything_goes(),
     proc_exe_settings: Assertion[ProcessExecutionSettings] = asrt.
     is_instance(ProcessExecutionSettings),
     instruction_settings: Assertion[InstructionSettings] = asrt.
     is_instance(InstructionSettings),
 ):
     self.validation = validation
     self.main_result = main_result
     self.settings_builder = settings_builder
     self.main_side_effects_on_sds = main_side_effects_on_sds
     self.main_side_effects_on_tcds = main_side_effects_on_tcds
     self.symbols_after_parse = symbols_after_parse
     self.symbols_after_main = symbols_after_main
     self.proc_exe_settings = proc_exe_settings
     self.instruction_settings = instruction_settings
コード例 #2
0
 def __init__(
     self,
     validation_pre_sds: Assertion = svh_assertions.is_success(),
     validation_post_setup: Assertion = svh_assertions.is_success(),
     main_result: Assertion[
         sh.SuccessOrHardError] = sh_assertions.is_success(),
     symbol_usages: Assertion = asrt.is_empty_sequence,
     main_side_effects_on_sds: Assertion = asrt.anything_goes(),
     main_side_effects_on_tcds: Assertion = asrt.anything_goes(),
     source: Assertion = asrt.anything_goes(),
     proc_exe_settings: Assertion[ProcessExecutionSettings] = asrt.
     is_instance(ProcessExecutionSettings),
     instruction_settings: Assertion[InstructionSettings] = asrt.
     is_instance(InstructionSettings),
 ):
     super().__init__(
         validation_pre_sds,
         validation_post_setup,
         main_result,
         symbol_usages,
         main_side_effects_on_sds,
         main_side_effects_on_tcds,
         proc_exe_settings,
         instruction_settings,
     )
     self.source = source
コード例 #3
0
 def __init__(self,
              main_result: ValueAssertion[SuccessOrHardError] = sh_assertions.is_success(),
              source: ValueAssertion[ParseSource] = asrt.anything_goes(),
              configuration: ValueAssertion[ConfigurationBuilder] = asrt.anything_goes(),
              file_ref_rel_root_2_conf: Callable[[pathlib.Path], ValueAssertion[ConfigurationBuilder]] =
              lambda x: asrt.anything_goes()
              ):
     self.main_result = main_result
     self.configuration = configuration
     self.file_ref_rel_root_2_conf = file_ref_rel_root_2_conf
     self.source = source
コード例 #4
0
 def __init__(self,
              result_of_validate_pre_sds: ValueAssertion = svh_assertions.is_success(),
              result_of_prepare: ValueAssertion = sh_assertions.is_success(),
              result_of_execute: ValueAssertion = eh_assertions.is_any_exit_code,
              symbol_usages: ValueAssertion = asrt.is_empty_sequence,
              side_effects_on_files_after_execute: ValueAssertion = asrt.anything_goes(),
              side_effects_on_files_after_prepare: ValueAssertion = asrt.anything_goes(),
              sub_process_result_from_execute: ValueAssertion = asrt.anything_goes()):
     self.result_of_validate_pre_sds = result_of_validate_pre_sds
     self.symbol_usages = symbol_usages
     self.side_effects_on_files_after_prepare = side_effects_on_files_after_prepare
     self.side_effects_on_files_after_execute = side_effects_on_files_after_execute
     self.result_of_prepare = result_of_prepare
     self.result_of_execute = result_of_execute
     self.sub_process_result_from_execute = sub_process_result_from_execute
コード例 #5
0
 def __init__(self,
              validation_pre_sds: ValueAssertion = svh_assertions.is_success(),
              validation_post_setup: ValueAssertion = svh_assertions.is_success(),
              main_result: ValueAssertion = sh_assertions.is_success(),
              symbol_usages: ValueAssertion = asrt.is_empty_sequence,
              main_side_effects_on_sds: ValueAssertion = asrt.anything_goes(),
              main_side_effects_on_home_and_sds: ValueAssertion = asrt.anything_goes(),
              source: ValueAssertion = asrt.anything_goes(),
              ):
     super().__init__(validation_pre_sds,
                      main_side_effects_on_sds,
                      main_side_effects_on_home_and_sds,
                      symbol_usages)
     self.validation_post_setup = validation_post_setup
     self.main_result = sh_assertions.is_sh_and(main_result)
     self.source = source
コード例 #6
0
ファイル: set_hds_dir.py プロジェクト: emilkarlen/exactly
    def runTest(self):
        path_argument_str = 'path-argument'

        self._check(
            syntax_for_assignment_of(path_argument_str),
            Arrangement(
                root_dir_contents=DirContents([empty_dir(path_argument_str)])
            ),
            Expectation(
                main_result=
                sh_assertions.is_success(),

                file_ref_rel_root_2_conf=
                self.conf_prop_equals(
                    lambda file_ref_rel_root: file_ref_rel_root / path_argument_str)
            )
        )
コード例 #7
0
 def __init__(
         self,
         validation: ValidationExpectationSvh = ValidationExpectationSvh.
     passes(),
         prepare: Assertion[
             sh.SuccessOrHardError] = sh_assertions.is_success(),
         execute: Assertion[ExitCodeOrHardError] = asrt_eh.is_any_exit_code,
         symbol_usages: Assertion[
             Sequence[SymbolUsage]] = asrt.is_empty_sequence,
         post_sds: Callable[
             [SandboxDs],
             PostSdsExpectation] = lambda sds: PostSdsExpectation(),
         after_execution: Assertion[TestCaseDs] = asrt.anything_goes(),
 ):
     self.symbol_usages = symbol_usages
     self.validation = validation
     self.prepare = prepare
     self.execute = execute
     self.post_sds = post_sds
     self.after_execution = after_execution
コード例 #8
0
 def __init__(self,
              pre_validation_result: ValueAssertion = svh_assertions.is_success(),
              main_result: ValueAssertion = sh_assertions.is_success(),
              post_validation_result: ValueAssertion = svh_assertions.is_success(),
              symbol_usages: ValueAssertion = asrt.is_empty_sequence,
              main_side_effects_on_sds: ValueAssertion = asrt.anything_goes(),
              main_side_effects_on_home_and_sds: ValueAssertion = asrt.anything_goes(),
              settings_builder: ValueAssertion = asrt.anything_goes(),
              source: ValueAssertion = asrt.anything_goes(),
              symbols_after_main: ValueAssertion = asrt.anything_goes(),
              ):
     self.pre_validation_result = pre_validation_result
     self.main_result = main_result
     self.main_side_effects_on_sds = main_side_effects_on_sds
     self.post_validation_result = post_validation_result
     self.settings_builder = settings_builder
     self.main_side_effects_on_home_and_sds = main_side_effects_on_home_and_sds
     self.source = source
     self.symbol_usages = symbol_usages
     self.symbols_after_main = symbols_after_main
コード例 #9
0
 def __init__(
     self,
     pre_validation_result: Assertion[
         svh.
         SuccessOrValidationErrorOrHardError] = svh_assertions.is_success(),
     main_result: Assertion[
         sh.SuccessOrHardError] = sh_assertions.is_success(),
     post_validation_result: Assertion[
         svh.
         SuccessOrValidationErrorOrHardError] = svh_assertions.is_success(),
     symbol_usages: Assertion[
         Sequence[SymbolUsage]] = asrt.is_empty_sequence,
     main_side_effects_on_sds: Assertion[SandboxDs] = asrt.anything_goes(),
     main_side_effects_on_tcds: Assertion[TestCaseDs] = asrt.anything_goes(
     ),
     settings_builder: Assertion[
         SettingsBuilderAssertionModel] = asrt_settings.
     stdin_is_not_present(),
     source: Assertion[ParseSource] = asrt.anything_goes(),
     symbols_after_main: Assertion[
         Sequence[SymbolUsage]] = asrt.anything_goes(),
     proc_exe_settings: Assertion[ProcessExecutionSettings] = asrt.
     is_instance(ProcessExecutionSettings),
     instruction_settings: Assertion[InstructionSettings] = asrt.
     is_instance(InstructionSettings)):
     super().__init__(
         ValidationExpectationSvh(pre_validation_result,
                                  post_validation_result),
         main_result,
         symbol_usages,
         main_side_effects_on_sds,
         main_side_effects_on_tcds,
         settings_builder,
         symbols_after_main,
         proc_exe_settings,
         instruction_settings,
     )
     self.source = source
     self.pre_validation_result = pre_validation_result
     self.post_validation_result = post_validation_result
コード例 #10
0
 def __init__(
     self,
     act_result: SubProcessResult = SubProcessResult(),
     validate_pre_sds_result: Assertion[
         svh.
         SuccessOrValidationErrorOrHardError] = svh_assertions.is_success(),
     main_result: Assertion[
         sh.SuccessOrHardError] = sh_assertions.is_success(),
     symbol_usages: Assertion[
         Sequence[SymbolUsage]] = asrt.is_empty_sequence,
     main_side_effects_on_sds: Assertion[SandboxDs] = asrt.anything_goes(),
     main_side_effects_on_tcds: Assertion[TestCaseDs] = asrt.anything_goes(
     ),
     proc_exe_settings: Assertion[ProcessExecutionSettings] = asrt.
     is_instance(ProcessExecutionSettings),
     instruction_settings: Assertion[InstructionSettings] = asrt.
     is_instance(InstructionSettings),
 ):
     super().__init__(validate_pre_sds_result, main_side_effects_on_sds,
                      main_side_effects_on_tcds, symbol_usages,
                      proc_exe_settings, instruction_settings)
     self._act_result = act_result
     self._main_result = main_result
 def expectation_for_zero_exitcode(self) -> Expectation:
     return Expectation(main_result=sh_assertions.is_success())
コード例 #12
0
 def expectation_for_zero_exitcode(self) -> Expectation:
     return Expectation(main_result=asrt_sh.is_success())
コード例 #13
0
ファイル: sh_assertions.py プロジェクト: emilkarlen/exactly
 def test_fail(self):
     # ARRANGE #
     actual = sh.new_sh_hard_error('failure msg')
     assertion = sut.is_success()
     # ACT #
     assert_that_assertion_fails(assertion, actual)
コード例 #14
0
ファイル: sh_assertions.py プロジェクト: emilkarlen/exactly
 def test_pass(self):
     # ARRANGE #
     assertion = sut.is_success()
     actual = sh.new_sh_success()
     # ACT #
     assertion.apply_without_message(self, actual)
コード例 #15
0
ファイル: sh_assertions.py プロジェクト: emilkarlen/exactly
 def test_fail(self):
     # ARRANGE #
     actual = sh.new_sh_hard_error__str('failure msg')
     assertion = sut.is_success()
     # ACT #
     assert_that_assertion_fails(assertion, actual)
コード例 #16
0
ファイル: sh_assertions.py プロジェクト: emilkarlen/exactly
 def test_pass(self):
     # ARRANGE #
     assertion = sut.is_success()
     actual = sh.new_sh_success()
     # ACT #
     assertion.apply_without_message(self, actual)