def clear_etos_lib_configurations(): """Make sure that etos library configuration is cleared after each test.""" config = Config() debug = Debug() yield config.reset() debug.events_received.clear() debug.events_published.clear()
def setUp(self): """Create a script file.""" script = ["#!/bin/bash", "echo Hello $1 > $(pwd)/output"] with open(self.script, "w", encoding="utf-8") as scriptfile: for line in script: scriptfile.write(f"{line}\n") self.config = Config() self.files = [self.script, Path.cwd().joinpath("output")]
def __init__(self, iut): """Initialize monitoring. :param iut: IUT object to monitor. :type iut: :obj:`etr.lib.iut.Iut` """ self.iut = iut self.config = Config()
def __init__(self, product): """Initialize. :param product: Dictionary to set attributes from. Should be the response from pool plugin list. :type product: dict """ self.test_runner = {} self.config = Config() self.config.set("scripts", []) self.steps = { "environment": self.load_environment, "commands": self.commands } product["identity"] = PackageURL.from_string(product["identity"]) for key, value in product.items(): setattr(self, key, value) self._product_dict = product self.jsontas = JsonTas() self.jsontas.dataset.add("iut", self._product_dict) self.prepare()
def setUp(self): os.environ["ETOS_CONFIGMAP"] = self.etos_configmap os.environ["SUITE_RUNNER"] = self.suite_runner Config().reset()