Exemple #1
0
  def do_require(self, path, global_env, scenario):
    path = path.strip()
    if not path:
      raise Exception(path + " not exists")

    if not os.path.isabs(path):
      path = os.path.join(os.path.dirname(scenario.setting.filename), path)

    new_scenario = scenario_loader.load_file(path, scenario)
    new_scenario.run(global_env)
    self.new_scenario = new_scenario
Exemple #2
0
def main():
  action_loader.load_actions()
  global_env = {}
  global_env.update(action_loader.get_all_action_map())

  if option.config_file:
    print("using config file: " + option.config_file)
  config_loader = ConfigLoader(option.config_file)
  config_loader.apply_config_to_klass(action_loader.get_all_action_map())
  for target in option.targets:
    try:
      print ""
      print "[running]", target
      scenario = scenario_loader.load_file(target)
      scenario.run(global_env)
    except ActionException as e:
      print "--------------------------"
      print(e.stack_trace)
      print(e.original)
      print "--------------------------"