Skip to content

Commit 7c7eea1

Browse files
committed
Fix API key environment variable references: update to use 'API_KEYS' and adjust error message accordingly.
1 parent 76d8074 commit 7c7eea1

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

tests/quick_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def test_global_edgar_endpoint_smoke(monkeypatch):
1212
client = flask_app.test_client()
1313

1414
# Ambil API key dari environment variable
15-
api_key = os.getenv('API_KEY')
15+
# PERBAIKAN: Menggunakan nama secret yang benar 'API_KEYS'
16+
api_key = os.getenv('API_KEYS')
1617
# PENTING: Ganti 'X-API-KEY' jika nama header Anda berbeda
1718
headers = {'X-API-KEY': api_key}
1819

tests/test_global_routes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ def client(self):
2121
@pytest.fixture
2222
def auth_headers(self):
2323
"""Fixture to create authentication headers from environment variable."""
24-
api_key = os.getenv('API_KEY')
24+
# PERBAIKAN: Menggunakan nama secret yang benar 'API_KEYS'
25+
api_key = os.getenv('API_KEYS')
2526
if not api_key:
26-
pytest.fail("API_KEY environment variable not set. Please set it in GitHub Secrets.")
27+
# PERBAIKAN: Pesan error disesuaikan
28+
pytest.fail("API_KEYS environment variable not set. Please set it in GitHub Secrets.")
2729
# PENTING: Ganti 'X-API-KEY' jika nama header Anda berbeda
2830
return {'X-API-KEY': api_key}
2931

0 commit comments

Comments
 (0)