Exemple #1
0
 def test_single_file_in_root_dir(self):
     # ARRANGE #
     expected_file = File.empty('file-name.txt')
     for phase_is_after_act in [False, True]:
         checker = integration_check.checker(phase_is_after_act)
         for rel_opt_conf in ALLOWED_DST_FILE_RELATIVITIES:
             with self.subTest(
                     relativity_option_string=rel_opt_conf.option_argument,
                     phase_is_after_act=phase_is_after_act):
                 instruction_syntax = abs_stx.without_contents(
                     rel_opt_conf.path_abs_stx_of_name(expected_file.name))
                 # ACT & ASSERT #
                 checker.check__abs_stx__std_layouts_and_source_variants(
                     self, instruction_syntax,
                     Arrangement.phase_agnostic(tcds=TcdsArrangement(
                         pre_population_action=
                         SETUP_CWD_INSIDE_SDS_BUT_NOT_A_SDS_DIR__PLAIN, ),
                                                ),
                     MultiSourceExpectation.phase_agnostic(
                         main_result=IS_SUCCESS,
                         side_effects_on_hds=f_asrt.dir_is_empty(),
                         symbol_usages=asrt.is_empty_sequence,
                         main_side_effects_on_sds=
                         non_hds_dir_contains_exactly(
                             rel_opt_conf.root_dir__non_hds,
                             fs.DirContents([expected_file])),
                     ))
Exemple #2
0
 def test_superfluous_arguments(self):
     # ARRANGE #
     valid_path = RelOptPathAbsStx(RelOptionType.REL_ACT, 'valid-file-name')
     valid_syntax = abs_stx.without_contents(valid_path)
     invalid_syntax = SequenceAbsStx.followed_by_superfluous(valid_syntax)
     # ACT & ASSERT #
     check_invalid_syntax__abs_stx(self, invalid_syntax)
Exemple #3
0
 def test_disallowed_relativities(self):
     # ARRANGE #
     for relativity in DISALLOWED_DST_RELATIVITIES:
         relativity_conf = conf_rel_any(relativity)
         instruction_syntax = abs_stx.without_contents(
             relativity_conf.path_abs_stx_of_name('file-name'))
         # ACT & ASSERT #
         check_invalid_syntax__abs_stx(self,
                                       instruction_syntax,
                                       sub_test_identifiers={
                                           'relativity': relativity,
                                       })
Exemple #4
0
 def test_missing_path(self):
     empty_path_argument = CustomPathAbsStx.empty()
     arguments_w_missing_path = abs_stx.without_contents(
         empty_path_argument)
     check_invalid_syntax__abs_stx(self, arguments_w_missing_path)