Ejemplo n.º 1
0
 def __init__(self,
              pre_contents_population_action: TcdsAction = TcdsAction(),
              hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
              sds_contents: sds_populator.SdsPopulator = sds_populator.empty(),
              non_hds_contents: non_hds_populator.NonHdsPopulator = non_hds_populator.empty(),
              tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.empty(),
              os_services: OsServices = os_services_access.new_for_current_os(),
              process_execution_settings: ProcessExecutionSettings = proc_exe_env_for_test(),
              default_environ_getter: DefaultEnvironGetter = get_empty_environ,
              post_sds_population_action: TcdsAction = TcdsAction(),
              symbols: SymbolTable = None,
              fs_location_info: FileSystemLocationInfo = ARBITRARY_FS_LOCATION_INFO,
              ):
     super().__init__(hds_contents=hds_contents,
                      process_execution_settings=process_execution_settings,
                      default_environ_getter=default_environ_getter)
     self.pre_contents_population_action = pre_contents_population_action
     self.sds_contents = sds_contents
     self.non_hds_contents = non_hds_contents
     self.tcds_contents = tcds_contents
     self.post_sds_population_action = post_sds_population_action
     self.os_services = os_services
     self.process_execution_settings = process_execution_settings
     self.symbols = symbol_table_from_none_or_value(symbols)
     self.fs_location_info = fs_location_info
Ejemplo n.º 2
0
 def __init__(self,
              pre_contents_population_action: TcdsAction = TcdsAction(),
              hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
              sds_contents: sds_populator.SdsPopulator = sds_populator.empty(),
              non_hds_contents: non_hds_populator.NonHdsPopulator = non_hds_populator.empty(),
              tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.empty(),
              post_sds_population_action: TcdsAction = TcdsAction(),
              act_result_producer: ActResultProducer = ActResultProducerFromActResult(),
              os_services: OsServices = os_services_access.new_for_current_os(),
              process_execution_settings: ProcessExecutionSettings = ProcessExecutionSettings.null(),
              default_environ_getter: DefaultEnvironGetter = get_empty_environ,
              symbols: SymbolTable = None,
              fs_location_info: FileSystemLocationInfo = ARBITRARY_FS_LOCATION_INFO,
              ):
     super().__init__(pre_contents_population_action=pre_contents_population_action,
                      sds_contents=sds_contents,
                      hds_contents=hds_contents,
                      non_hds_contents=non_hds_contents,
                      tcds_contents=tcds_contents,
                      post_sds_population_action=post_sds_population_action,
                      os_services=os_services,
                      process_execution_settings=process_execution_settings,
                      default_environ_getter=default_environ_getter,
                      symbols=symbols,
                      fs_location_info=fs_location_info)
     self.act_result_producer = act_result_producer
Ejemplo n.º 3
0
def arrangement(
    pre_contents_population_action: TcdsAction = TcdsAction(),
    hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
    sds_contents_before_main: sds_populator.SdsPopulator = sds_populator.empty(
    ),
    non_hds_contents_before_main: non_hds_populator.
    NonHdsPopulator = non_hds_populator.empty(),
    tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.empty(),
    act_result_producer: ActResultProducer = ActResultProducerFromActResult(),
    os_services: OsServices = new_for_current_os(),
    process_execution_settings:
    ProcessExecutionSettings = ProcessExecutionSettings.null(),
    default_environ_getter: DefaultEnvironGetter = get_empty_environ,
    symbols: SymbolTable = None,
) -> ArrangementPostAct:
    return ArrangementPostAct(
        pre_contents_population_action=pre_contents_population_action,
        hds_contents=hds_contents,
        sds_contents=sds_contents_before_main,
        non_hds_contents=non_hds_contents_before_main,
        tcds_contents=tcds_contents,
        act_result_producer=act_result_producer,
        os_services=os_services,
        process_execution_settings=process_execution_settings,
        default_environ_getter=default_environ_getter,
        symbols=symbols)
Ejemplo n.º 4
0
 def __init__(
     self,
     pre_contents_population_action: TcdsAction = TcdsAction(),
     hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
     sds_contents_before_main: sds_populator.SdsPopulator = sds_populator.
     empty(),
     non_hds_contents_before_main: non_hds_populator.
     NonHdsPopulator = non_hds_populator.empty(),
     tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.empty(),
     os_services: OsServices = new_for_current_os(),
     process_execution_settings:
     ProcessExecutionSettings = ProcessExecutionSettings.null(),
     default_environ_getter: DefaultEnvironGetter = get_empty_environ,
     previous_phase: PreviousPhase = PreviousPhase.ASSERT,
     symbols: SymbolTable = None,
     fs_location_info: FileSystemLocationInfo = ARBITRARY_FS_LOCATION_INFO,
 ):
     super().__init__(
         pre_contents_population_action=pre_contents_population_action,
         hds_contents=hds_contents,
         sds_contents=sds_contents_before_main,
         non_hds_contents=non_hds_contents_before_main,
         tcds_contents=tcds_contents,
         os_services=os_services,
         process_execution_settings=process_execution_settings,
         default_environ_getter=default_environ_getter,
         symbols=symbols,
         fs_location_info=fs_location_info)
     self.previous_phase = previous_phase
Ejemplo n.º 5
0
 def __init__(
     self,
     pre_contents_population_action: TcdsAction = TcdsAction(),
     hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
     sds_contents_before_main: sds_populator.SdsPopulator = sds_populator.
     empty(),
     non_hds_contents: non_hds_populator.
     NonHdsPopulator = non_hds_populator.empty(),
     tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.empty(),
     os_services: OsServices = os_services_access.new_for_current_os(),
     process_execution_settings:
     ProcessExecutionSettings = ProcessExecutionSettings.null(),
     default_environ_getter: DefaultEnvironGetter = get_empty_environ,
     settings_builder: Optional[SetupSettingsBuilder] = None,
     symbols: SymbolTable = None,
     fs_location_info: FileSystemLocationInfo = ARBITRARY_FS_LOCATION_INFO,
 ):
     super().__init__(
         pre_contents_population_action=pre_contents_population_action,
         hds_contents=hds_contents,
         sds_contents=sds_contents_before_main,
         non_hds_contents=non_hds_contents,
         tcds_contents=tcds_contents,
         os_services=os_services,
         process_execution_settings=process_execution_settings,
         default_environ_getter=default_environ_getter,
         symbols=symbols,
         fs_location_info=fs_location_info,
     )
     self.initial_settings_builder = settings_handlers.builder_from_optional(
         settings_builder)
Ejemplo n.º 6
0
 def __init__(
         self,
         tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.
     empty(),
         hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
         non_hds_contents: non_hds_populator.
     NonHdsPopulator = non_hds_populator.empty(),
         pre_population_action: PlainTcdsAction = PlainTcdsAction(),
         post_population_action: PlainTcdsAction = PlainTcdsAction(),
 ):
     self.hds_contents = hds_contents
     self.non_hds_contents = non_hds_contents
     self.tcds_contents = tcds_contents
     self.pre_population_action = pre_population_action
     self.post_population_action = post_population_action
Ejemplo n.º 7
0
 def __init__(
         self,
         tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.
     empty(),
         hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
         non_hds_contents: non_hds_populator.
     NonHdsPopulator = non_hds_populator.empty(),
         act_result: ActResultProducer = ActResultProducerFromActResult(),
         pre_population_action: PlainTcdsAction = PlainTcdsAction(),
         post_population_action: PlainTcdsAction = PlainTcdsAction(),
 ):
     self.hds_contents = hds_contents
     self.non_hds_contents = non_hds_contents
     self.tcds_contents = tcds_contents
     self.act_result = act_result
     self.pre_population_action = pre_population_action
     self.post_population_action = post_population_action
Ejemplo n.º 8
0
 def __init__(
         self,
         tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.
     empty(),
         hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
         non_hds_contents: non_hds_populator.
     NonHdsPopulator = non_hds_populator.empty(),
         sds_contents: sds_populator.SdsPopulator = sds_populator.empty(),
         act_result: Optional[ActResultProducer] = None,
         pre_population_action: PlainTcdsAction = PlainTcdsAction(),
         post_population_action: PlainTcdsAction = PlainTcdsAction(),
 ):
     self.hds_contents = hds_contents
     self.sds_contents = sds_contents
     self.non_hds_contents = non_hds_populator.multiple(
         [non_hds_contents, sds_contents])
     self.tcds_contents = tcds_contents
     self.act_result = act_result
     self.pre_population_action = pre_population_action
     self.post_population_action = post_population_action
Ejemplo n.º 9
0
def tcds_with_act_as_curr_dir(
        hds_contents: hds_populators.HdsPopulator = hds_populators.empty(),
        sds_contents: sds_populator.SdsPopulator = sds_populator.empty(),
        non_hds_contents: non_hds_populator.NonHdsPopulator = non_hds_populator.empty(),
        tcds_contents: tcds_populators.TcdsPopulator = tcds_populators.empty(),
        pre_contents_population_action: TcdsAction = TcdsAction(),
        symbols: SymbolTable = None) -> ContextManager[PathResolvingEnvironmentPreOrPostSds]:
    symbols = symbol_table_from_none_or_value(symbols)
    prefix = strftime(program_info.PROGRAM_NAME + '-test-%Y-%m-%d-%H-%M-%S', localtime())
    with home_directory_structure(prefix=prefix + '-home') as hds:
        with sandbox_directory_structure(prefix=prefix + "-sds-") as sds:
            tcds = TestCaseDs(hds, sds)
            ret_val = PathResolvingEnvironmentPreOrPostSds(tcds, symbols)
            with preserved_cwd():
                os.chdir(str(sds.act_dir))
                pre_contents_population_action.apply(ret_val)
                hds_contents.populate_hds(hds)
                sds_contents.populate_sds(sds)
                non_hds_contents.populate_non_hds(sds)
                tcds_contents.populate_tcds(tcds)
                yield ret_val