Skip to content

Commit

Permalink
Added env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ivntsng committed Nov 12, 2024
1 parent 2cc6e46 commit 085daf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ env:
AWS_SECRET_ACCESS_KEY: test
AWS_ENDPOINT_URL_DYNAMODB: http://localhost:8000
AWS_REGION: us-east-1
CLOUDFRONT_KEY_ID: ${{ secrets.CLOUDFRONT_KEY_ID }}
CLOUDFRONT_PRIVATE_KEY: ${{ secrets.CLOUDFRONT_PRIVATE_KEY }}
CLOUDFRONT_DOMAIN: ${{ secrets.CLOUDFRONT_DOMAIN }}
CLOUDFRONT_PRIVATE_KEY_PATH: /tmp/dummy_key.pem
ONSHAPE_API: ${{ secrets.ONSHAPE_API }}
ONSHAPE_ACCESS_KEY: ${{ secrets.ONSHAPE_ACCESS_KEY }}
ONSHAPE_SECRET_KEY: ${{ secrets.ONSHAPE_SECRET_KEY }}
Expand Down
17 changes: 0 additions & 17 deletions tests/test_images.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
"""Runs tests on the image uploading APIs."""

from pathlib import Path
from typing import Generator
from unittest.mock import patch

import pytest
from fastapi import status
from fastapi.testclient import TestClient
from PIL import Image


@pytest.fixture(autouse=True)
def mock_env_vars() -> Generator[None, None, None]:
"""Mock the required environment variables for CloudFront."""
with patch.dict(
"os.environ",
{
"CLOUDFRONT_KEY_ID": "dummy_key_id",
"CLOUDFRONT_PRIVATE_KEY": "dummy_private_key",
"CLOUDFRONT_DOMAIN": "dummy.cloudfront.net",
},
):
yield


def test_user_auth_functions(test_client: TestClient, tmpdir: Path) -> None:
# Get an auth token using the mocked Github endpoint.
response = test_client.post("/auth/github/code", json={"code": "test_code"})
Expand Down

0 comments on commit 085daf5

Please sign in to comment.