def setup_class(cls): # don't create project automatically (goal of these tests...) if not cls.session: config = Config() try: alias = config.parser.get('azkaban', 'test.alias') except (NoOptionError, NoSectionError): pass else: cls.session = Session.from_alias(alias)
def setup_class(cls): if not cls.session: config = Config() try: alias = config.parser.get('azkaban', 'test.alias') except (NoOptionError, NoSectionError): pass else: cls.session = Session.from_alias(alias) try: cls.session.create_project(cls.project_name, 'Testing project.') except AzkabanError: pass # project already exists somehow
def _get_session(url, alias): """Get appropriate session. :param url: URL (has precedence over alias). :param alias: Alias name. """ config = Config() if url: return Session(url=url, config=config) else: alias = alias or config.get_option('azkaban', 'default.alias') return Session.from_alias(alias=alias, config=config)
def session(self): if self.parsed.azkaban_url is not None: return Session(url=self.parsed.azkaban_url, verify=True) if self.parsed.azkaban_alias is not None: return Session.from_alias(self.parsed.azkaban_alias)