def store_environment(self): if not self.environment: return environment = Environment(id=uuid.uuid4(), name="Allure environment parameters", parameters=[]) for key, value in iteritems(self.environment): environment.parameters.append( EnvParameter(name=key, key=key, value=value)) with self._reportfile('environment.xml') as f: self._write_xml(f, environment)
def store_environment(self, environmentlist): '''Extension of allure.AllureImpl.store_environment due to lacking URL parameter''' if not self.environment: return id = environmentlist['id'] name = environmentlist['name'] url = environmentlist['url'] environment = Environment(id=id, name=name, url=url, parameters=[]) for key, value in iteritems(self.environment): environment.parameters.append( EnvParameter(name=key, key=key, value=value)) with self._reportfile('environment.xml') as f: self._write_xml(f, environment)