Skip to content

Commit

Permalink
chore: add simple app auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Oct 7, 2024
1 parent 51d734a commit e31c838
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# *******************************************************************************
# Copyright (c) 2024 Eclipse Foundation and others.
# This program and the accompanying materials are made available
# under the terms of the Eclipse Public License 2.0
# which is available at http://www.eclipse.org/legal/epl-v20.html
# SPDX-License-Identifier: EPL-2.0
# *******************************************************************************
import logging

import pytest

from otterdog.providers.github.auth import app_auth
from otterdog.providers.github.rest import RestApi

_logger = logging.getLogger(__name__)

_APP_ID = ""
_APP_PRIVATE_KEY = ""


@pytest.mark.asyncio
@pytest.mark.skipif(not _APP_ID, reason="need to fill in app values")
async def test_list_installations():
async with RestApi(app_auth(_APP_ID, _APP_PRIVATE_KEY)) as rest_api:
installations = await rest_api.app.get_app_installations()

for installation in installations:
permissions = installation["permissions"]
if "merge_queue" not in permissions:
_logger.info(f"{installation['account']['login']} -> missing merge_queue permission")

0 comments on commit e31c838

Please sign in to comment.