diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 699dafc..78ad675 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -46,3 +46,5 @@ jobs: - name: Test with unittest run: | poetry run python -m unittest discover + env: + API_KEY: ${{ secrets.API_KEY }} \ No newline at end of file diff --git a/tests/test.py b/tests/test.py index 51ad550..8f5d97e 100755 --- a/tests/test.py +++ b/tests/test.py @@ -1,5 +1,6 @@ """Testing Synchronous and Asynchronous Extraction""" +import os import sys import unittest @@ -14,8 +15,12 @@ class TestAnyParser(unittest.TestCase): """Testing Any Parser""" def setUp(self): - self.api_key = "..." # insert public API key + # get secret API key + self.api_key = os.environ.get("API_KEY") + if not self.api_key: + raise ValueError("API_KEY environment variable is not set") self.file_path = "../examples/sample_data/stoxx_index_guide_0003.pdf" + # create instance of AnyParser self.ap = AnyParser(self.api_key) def test_sync_extract(self):