예제 #1
0
 def runTest(self):
     file_name = 'existing-plain-file'
     self._check(
         syntax_for_assignment_of(file_name),
         Arrangement(
             root_dir_contents=DirContents([File.empty(file_name)])),
         Expectation(main_result=svh_assertions.is_validation_error()))
예제 #2
0
 def runTest(self):
     directory_name = 'existing-directory'
     self._check(
         syntax_for_assignment_of(directory_name),
         Arrangement(
             root_dir_contents=DirContents([Dir.empty(directory_name)])),
         Expectation(path_rel_root_2_conf=self.conf_prop_equals(
             lambda path_rel_root_dir: path_rel_root_dir / directory_name)))
예제 #3
0
 def runTest(self):
     first_dir = 'first_dir'
     second_dir = 'second_dir'
     self._check(
         syntax_for_assignment_of('{}/{}'.format(first_dir, second_dir)),
         Arrangement(root_dir_contents=DirContents(
             [Dir(first_dir, [Dir.empty(second_dir)])])),
         Expectation(path_rel_root_2_conf=self.conf_prop_equals(
             lambda path_rel_root_dir: path_rel_root_dir / first_dir /
             second_dir)))
예제 #4
0
 def _run(self, expected: tcs.TestCaseStatus, initial: tcs.TestCaseStatus,
          argument: str):
     for source in equivalent_source_variants__with_source_check__consume_last_line(
             self, argument):
         self._check(
             sut.Parser(), source,
             Arrangement(test_case_status=initial,
                         actor=actor_that_runs_constant_actions()),
             Expectation(configuration=asrt_conf.matches(
                 status=asrt.is_(expected))))
예제 #5
0
    def runTest(self):
        path_argument_str = 'path-argument'

        self._check(
            syntax_for_assignment_of(path_argument_str),
            Arrangement(
                root_dir_contents=DirContents([Dir.empty(path_argument_str)])),
            Expectation(
                main_result=svh_assertions.is_success(),
                path_rel_root_2_conf=self.conf_prop_equals(
                    lambda path_rel_root: path_rel_root / path_argument_str)))
예제 #6
0
 def test_fail_due_to_fail_of_side_effects_on_configuration(self):
     with self.assertRaises(test_misc.TestError):
         self._check(
             ParserThatGives(_SUCCESSFUL_INSTRUCTION), single_line_source(),
             Arrangement(),
             Expectation(configuration=test_misc.raises_test_error()))
예제 #7
0
 def test_fail_due_to_unexpected_result_from_main(self):
     with self.assertRaises(test_misc.TestError):
         self._check(ParserThatGives(_SUCCESSFUL_INSTRUCTION),
                     single_line_source(), Arrangement(),
                     Expectation(main_result=test_misc.raises_test_error()))
예제 #8
0
 def test_successful_flow(self):
     self._check(ParserThatGives(_SUCCESSFUL_INSTRUCTION),
                 single_line_source(), Arrangement(), Expectation())
예제 #9
0
 def runTest(self):
     self._check(
         syntax_for_assignment_of('..'), Arrangement(),
         Expectation(path_rel_root_2_conf=self.conf_prop_equals(
             lambda path_rel_root_dir: path_rel_root_dir.parent)))
예제 #10
0
 def runTest(self):
     self._check(
         syntax_for_assignment_of('non-existing-path'), Arrangement(),
         Expectation(main_result=svh_assertions.is_validation_error()))