Repository navigation
Expand file tree
/
Copy pathtest_package.py
More file actions
80 lines (73 loc) · 1.77 KB
/
Copy pathtest_package.py
File metadata and controls
80 lines (73 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import pytest
_ministack_installed = True
_requires_package = pytest.mark.skipif(
not _ministack_installed,
reason="ministack not installed locally (runs in CI via pip install -e .)",
)
@_requires_package
def test_package_core_importable():
"""ministack.core modules must all be importable."""
from ministack.core.lambda_runtime import get_or_create_worker
from ministack.core.persistence import save_all
from ministack.core.responses import json_response
from ministack.core.router import detect_service
assert callable(json_response)
assert callable(detect_service)
assert callable(get_or_create_worker)
assert callable(save_all)
@_requires_package
def test_package_services_importable():
"""All 25 ministack.services modules must be importable and expose handle_request."""
from ministack.services import (
apigateway,
athena,
cloudwatch,
cloudwatch_logs,
cognito,
dynamodb,
ecs,
elasticache,
eventbridge,
firehose,
glue,
iam,
kinesis,
lambda_svc,
rds,
route53,
s3,
secretsmanager,
ses,
sns,
sqs,
ssm,
stepfunctions,
sts,
)
for mod in [
s3,
sqs,
sns,
dynamodb,
lambda_svc,
secretsmanager,
cloudwatch_logs,
ssm,
eventbridge,
kinesis,
cloudwatch,
ses,
stepfunctions,
ecs,
rds,
elasticache,
glue,
athena,
apigateway,
firehose,
route53,
cognito,
iam,
sts,
]:
assert callable(getattr(mod, "handle_request", None)), f"{mod.__name__} missing handle_request"