Skip to content

Commit b465a0d

Browse files
committed
Add testing
- initial test for setup
1 parent d574ecf commit b465a0d

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/
2+
.pytest_cache/
3+
__pycache__/
4+
*.py[cod]

Diff for: requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
boto3>=1.0.0
2+
moto[cloudwatch, ec2, ecs, logs, sqs, s3]>=4.1.4
3+
pytest>=7.2.2

Diff for: tests/conftest.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pytest
2+
import os, sys
3+
4+
current = os.path.dirname(os.path.realpath(__file__))
5+
parent_directory = os.path.dirname(current)
6+
sys.path.append(parent_directory)
7+
8+
@pytest.fixture(scope="function")
9+
def aws_credentials():
10+
"""Mocked AWS Credentials for moto."""
11+
os.environ["AWS_ACCESS_KEY_ID"] = "testing"
12+
os.environ["AWS_SECRET_ACCESS_KEY"] = "testing"
13+
os.environ["AWS_SECURITY_TOKEN"] = "testing"
14+
os.environ["AWS_SESSION_TOKEN"] = "testing"
15+
os.environ["AWS_DEFAULT_REGION"] = "us-east-1"

Diff for: tests/test_simple.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pytest
2+
3+
from moto import mock_sqs
4+
5+
from config import SQS_QUEUE_NAME
6+
7+
import json
8+
9+
10+
@mock_sqs
11+
def test_setup(aws_credentials):
12+
import run
13+
run.WAIT_TIME = 0
14+
run.setup()

0 commit comments

Comments
 (0)