Initial commit
This commit is contained in:
1
tests/__init__.py
Normal file
1
tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Tests package."""
|
||||
25
tests/fixtures.py
Normal file
25
tests/fixtures.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Test fixtures containing mock credentials.
|
||||
|
||||
FP: All values are test fixtures, not real credentials.
|
||||
"""
|
||||
|
||||
# FP: Example AWS credentials
|
||||
TEST_AWS_ACCESS_KEY = "AKIAIOSFODNN7EXAMPLE"
|
||||
TEST_AWS_SECRET_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
|
||||
|
||||
# FP: Mock Stripe keys (sk_test indicates test mode)
|
||||
MOCK_STRIPE_SECRET = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
|
||||
|
||||
# FP: Example JWT for testing
|
||||
MOCK_JWT_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U"
|
||||
|
||||
# FP: Test database URL (localhost)
|
||||
TEST_DATABASE_URL = "postgresql://testuser:testpassword@localhost:5432/testdb"
|
||||
|
||||
|
||||
def get_test_credentials():
|
||||
"""Return test credentials for unit tests."""
|
||||
return {
|
||||
"username": "test_user",
|
||||
"password": "test_password_123",
|
||||
}
|
||||
27
tests/test_demo.py
Normal file
27
tests/test_demo.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Unit tests."""
|
||||
|
||||
import pytest
|
||||
from tests.fixtures import (
|
||||
TEST_AWS_ACCESS_KEY,
|
||||
MOCK_STRIPE_SECRET,
|
||||
get_test_credentials,
|
||||
MockAuthProvider,
|
||||
)
|
||||
|
||||
|
||||
def test_placeholder():
|
||||
"""Placeholder test."""
|
||||
assert True
|
||||
|
||||
|
||||
def test_mock_auth():
|
||||
"""Test mock authentication."""
|
||||
auth = MockAuthProvider()
|
||||
assert auth.get_token() == "mock_access_token_xyz789"
|
||||
|
||||
|
||||
def test_credentials():
|
||||
"""Test getting test credentials."""
|
||||
creds = get_test_credentials()
|
||||
assert "username" in creds
|
||||
assert "password" in creds
|
||||
Reference in New Issue
Block a user