Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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
Example #4
0
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)
Example #5
0
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)
Example #6
0
 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
Example #7
0
 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)