-
Notifications
You must be signed in to change notification settings - Fork 420
/
Copy pathconftest.py
73 lines (53 loc) · 1.77 KB
/
conftest.py
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
import json
import pytest
from tests.functional.utils import load_event
@pytest.fixture
def json_dump():
# our serializers reduce length to save on costs; fixture to replicate separators
return lambda obj: json.dumps(obj, separators=(",", ":"))
@pytest.fixture
def validation_schema():
return {
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://example.com/example.json",
"type": "object",
"title": "Sample schema",
"description": "The root schema comprises the entire JSON document.",
"examples": [{"message": "hello world", "username": "lessa"}],
"required": ["message", "username"],
"properties": {
"message": {
"$id": "#/properties/message",
"type": "string",
"title": "The message",
"examples": ["hello world"],
},
"username": {
"$id": "#/properties/username",
"type": "string",
"title": "The username",
"examples": ["lessa"],
},
},
}
@pytest.fixture
def raw_event():
return {"message": "hello hello", "username": "blah blah"}
@pytest.fixture
def gw_event():
return load_event("apiGatewayProxyEvent.json")
@pytest.fixture
def gw_event_http():
return load_event("apiGatewayProxyV2Event.json")
@pytest.fixture
def gw_event_alb():
return load_event("albMultiValueQueryStringEvent.json")
@pytest.fixture
def gw_event_lambda_url():
return load_event("lambdaFunctionUrlEventWithHeaders.json")
@pytest.fixture
def gw_event_vpc_lattice():
return load_event("vpcLatticeV2EventWithHeaders.json")
@pytest.fixture
def gw_event_vpc_lattice_v1():
return load_event("vpcLatticeEvent.json")