Ejemplo n.º 1
0
 def __init__(self, method_name):
     super().__init__(method_name)
     self.constructor = sut.actor()
     self.hds = fake_hds()
     self.pre_sds_env = InstructionEnvironmentPreSdsBuilder(
         self.hds,
         environ=dict(os.environ),
     ).build
 def _do_parse_and_validate_pre_sds(
     self,
     instructions: Sequence[ActPhaseInstruction],
     home_dir_contents: DirContents = empty_dir_contents()):
     with home_directory_structure(
             contents=hds_case_dir_contents(home_dir_contents)) as hds:
         pre_sds_env = InstructionEnvironmentPreSdsBuilder.of_empty_env(
             hds=hds).build
         executor = self.actor.parse(instructions)
         return executor.validate_pre_sds(pre_sds_env)
 def runTest(self):
     act_phase_instructions = [instr(['system-under-test'])]
     with home_directory_structure(contents=contents_in(
             RelHdsOptionType.REL_HDS_ACT,
             fs.DirContents([fs.executable_file('system-under-test')
                             ]))) as hds:
         environment = InstructionEnvironmentPreSdsBuilder.of_empty_env(
             hds=hds).build
         executor = self.actor.parse(act_phase_instructions)
         actual = executor.validate_pre_sds(environment)
     self.assertIs(svh.SuccessOrValidationErrorOrHardErrorEnum.SUCCESS,
                   actual.status, 'Validation result')
Ejemplo n.º 4
0
def env_with_symbol_table(symbols: List[SymbolContext]) -> InstructionEnvironmentForPreSdsStep:
    symbols = SymbolContext.symbol_table_of_contexts(symbols)
    return InstructionEnvironmentPreSdsBuilder.of_empty_env(symbols=symbols).build
Ejemplo n.º 5
0
def env_with_singleton_symbol_table(symbol: SymbolContext) -> InstructionEnvironmentForPreSdsStep:
    return InstructionEnvironmentPreSdsBuilder.of_empty_env(symbols=symbol.symbol_table).build
Ejemplo n.º 6
0
def env_with_empty_symbol_table() -> InstructionEnvironmentForPreSdsStep:
    return InstructionEnvironmentPreSdsBuilder.of_empty_env().build
Ejemplo n.º 7
0
def _environment() -> InstructionEnvironmentForPreSdsStep:
    return InstructionEnvironmentPreSdsBuilder.of_empty_env().build
 def _new_environment() -> InstructionEnvironmentForPreSdsStep:
     hds = fake_hds()
     return InstructionEnvironmentPreSdsBuilder.of_empty_env(hds).build