Ejemplo n.º 1
0
 def __init__(self, github_org: str):
     s = settings.Settings()
     if s.github_access_token:
         self.github = Github(s.github_access_token)
     else:
         self.github = Github()
     if not github_org:
         github_org = constants.MAIN_GITHUB_ASWF_ORG
     self.repo = self.github.get_repo(
         f"{github_org}/{constants.MAIN_GITHUB_REPO_NAME}")
Ejemplo n.º 2
0
 def test_settings_cli(self):
     runner = CliRunner()
     with tempfile.TemporaryDirectory() as tmpdirname:
         settings_path = os.path.join(tmpdirname, "tmpsettings.yaml")
         result = runner.invoke(
             aswfdocker.cli,
             [
                 "settings",
                 "--github-access-token",
                 "foobar",
                 "--settings-path",
                 settings_path,
             ],
         )
         self.assertEqual(result.output, "")
         self.assertEqual(result.exit_code, 0)
         s = settings.Settings(settings_path=settings_path)
         self.assertEqual(s.github_access_token, "foobar")
Ejemplo n.º 3
0
def settings(settings_path, github_access_token):
    """Sets user settings
    """
    s = aswf_settings.Settings(settings_path=settings_path)
    s.github_access_token = github_access_token
    s.save()