Ejemplo n.º 1
0
 def test_populate_non_hds(self):
     populated_dir_contents = DirContents([File.empty('non-hds-file.txt')])
     self._check(
         PARSER_THAT_GIVES_SUCCESSFUL_INSTRUCTION,
         single_line_source(),
         sut.Arrangement(non_hds_contents=non_hds_populator.rel_option(
             non_hds_populator.RelNonHdsOptionType.REL_TMP,
             populated_dir_contents)),
         sut.Expectation(
             main_side_effects_on_sds=tmp_user_dir_contains_exactly(
                 populated_dir_contents)),
     )
Ejemplo n.º 2
0
 def test_populate_non_hds(self):
     populated_dir_contents = DirContents([File.empty('non-hds-file.txt')])
     self._check_source_and_exe_variants(
         PARSER_THAT_GIVES_SUCCESSFUL_INSTRUCTION,
         Arrangement.phase_agnostic(
             tcds=TcdsArrangement(
                 non_hds_contents=non_hds_populator.rel_option(RelNonHdsOptionType.REL_TMP,
                                                               populated_dir_contents)),
         ),
         MultiSourceExpectation.phase_agnostic(
             main_side_effects_on_sds=tmp_user_dir_contains_exactly(
                 populated_dir_contents)),
     )
Ejemplo n.º 3
0
 def test_populate_non_hds(self):
     populated_dir_contents = DirContents([File.empty('non-home-file.txt')])
     self._check___single_and_multi(
         utils.single_line_arguments(),
         ARBITRARY_MODEL,
         parser_of_matcher_that_is_an_assertion_on_tcds(
             self,
             sds_2_tcds_assertion(
                 tmp_user_dir_contains_exactly(populated_dir_contents)
             )
         ),
         arrangement_w_tcds(
             non_hds_contents=non_hds_populator.rel_option(
                 non_hds_populator.RelNonHdsOptionType.REL_TMP,
                 populated_dir_contents)),
         Expectation(),
     )
Ejemplo n.º 4
0
    def _check(self,
               file_type_to_check_for: FileType,
               expected_result: bool,
               base_name_of_file_to_check: str,
               dir_contents: DirContents):

        # ACT #
        integration_check.CHECKER__PARSE_FULL.check__w_source_variants(
            self,
            ArgumentElements(arg.Type(file_type_to_check_for).elements).as_arguments,
            integration_check.constant_relative_file_name(base_name_of_file_to_check),
            arrangement_w_tcds(
                non_hds_contents=non_hds_populator.rel_option(RelNonHdsOptionType.REL_CWD, dir_contents),
            ),
            Expectation(
                execution=ExecutionExpectation(
                    main_result=asrt_matching_result.matches_value(expected_result),
                ),
            )
        )
Ejemplo n.º 5
0
 def populator_for_relativity_option_root__non_hds(
         self, contents: DirContents) -> NonHdsPopulator:
     return non_hds_populator.rel_option(self.relativity_non_hds, contents)
Ejemplo n.º 6
0
def single_file_in_current_dir(f: FileSystemElement) -> NonHdsPopulator:
    return non_hds_populator.rel_option(RelNonHdsOptionType.REL_ACT,
                                        DirContents([f]))