From 244c189eac974c483d1935b8a18c98aa0adf13db Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 9 Oct 2024 23:26:55 +0200 Subject: [PATCH] use amazon credentials on workflow --- .github/workflows/lint-and-test.yml | 6 ++++++ tests/integration_test.py | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/integration_test.py diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 924d6a6..c85dded 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -6,6 +6,12 @@ on: permissions: pull-requests: read +env: + API_KEY: ${{ secrets.API_KEY }} + API_SECRET: ${{ secrets.API_SECRET }} + AFFILIATE_TAG: ${{ secrets.AFFILIATE_TAG }} + COUNTRY_CODE: ${{ secrets.COUNTRY_CODE }} + jobs: ruff: runs-on: ubuntu-latest diff --git a/tests/integration_test.py b/tests/integration_test.py new file mode 100644 index 0000000..71abf86 --- /dev/null +++ b/tests/integration_test.py @@ -0,0 +1,17 @@ +import os +from unittest import TestCase, skipUnless + + +def are_credentials_defined() -> bool: + api_key = os.environ.get("API_KEY") + api_secret = os.environ.get("API_SECRET") + affiliate_tag = os.environ.get("AFFILIATE_TAG") + country_code = os.environ.get("COUNTRY_CODE") + + return all([api_key, api_secret, affiliate_tag, country_code]) + + +@skipUnless(are_credentials_defined(), "Needs Amazon API credentials") +class IntegrationTest(TestCase): + def test_it_works(self): + self.assertTrue(True)