-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
142 lines (130 loc) · 4.66 KB
/
conftest.py
File metadata and controls
142 lines (130 loc) · 4.66 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
from datetime import datetime
from zoneinfo import ZoneInfo
from bs4 import BeautifulSoup
from pytest import fixture
from grupy_sanca_agenda_bot.schemas import Event
from grupy_sanca_agenda_bot.settings import settings
@fixture
def meetup_homepage_soup():
with open("tests/fixtures/meetup_homepage_example.html") as f:
return BeautifulSoup(f, "html.parser")
@fixture
def meetup_event_page_soup():
with open("tests/fixtures/meetup_event_page_example.html") as f:
return BeautifulSoup(f, "html.parser")
@fixture
def open_event_api_response():
return {
"data": [
{
"type": "event",
"relationships": {},
"id": "123456",
"attributes": {
"name": "Sample Event",
"starts-at": "2024-07-01T10:00:00+00:00",
"location-name": "Sample Location",
"description": "This is a sample event description.",
"url": "https://example.com/events/123456", # Example URL
"identifier": "sample-event-123456",
},
"links": {"self": "https://api.example.com/events/123456"},
},
{
"type": "event",
"relationships": {},
"id": "789012",
"attributes": {
"name": "Another Event",
"starts-at": "2024-07-15T15:00:00+00:00",
"location-name": None,
"description": "This is another event description.",
"url": "https://example.com/events/789012", # Example URL
"identifier": "another-event-789012",
},
"links": {"self": "https://api.example.com/events/789012"},
},
]
}
@fixture
def open_event_api_response_unsorted():
return {
"data": [
{
"type": "event",
"relationships": {},
"id": "123456",
"attributes": {
"name": "Sample Event",
"starts-at": "2024-07-15T10:00:00+00:00",
"location-name": "Sample Location",
"description": "This is a sample event description.",
"url": "https://example.com/events/123456", # Example URL
"identifier": "sample-event-123456",
},
"links": {"self": "https://api.example.com/events/123456"},
},
{
"type": "event",
"relationships": {},
"id": "789012",
"attributes": {
"name": "Another Event",
"starts-at": "2024-07-14T09:00+00:00",
"location-name": None,
"description": "This is another event description.",
"url": "https://example.com/events/789012", # Example URL
"identifier": "another-event-789012",
},
"links": {"self": "https://api.example.com/events/789012"},
},
]
}
@fixture
def events():
return [
Event(
id=None,
identifier="1",
title="Event 1",
date_time=datetime.fromisoformat("2024-07-10T20:00:00-03:00").replace(
tzinfo=ZoneInfo(settings.TIMEZONE)
),
location="Location 1",
description="Description 1",
link="https://example.com/events/1",
),
Event(
id=None,
identifier="2",
title="Event 2",
date_time=datetime.fromisoformat("2024-07-15T15:00:00-03:00").replace(
tzinfo=ZoneInfo(settings.TIMEZONE)
),
location="Location 2",
description="Description 2",
link="https://example.com/events/2",
),
Event(
id=None,
identifier="3",
title="Event 3",
date_time=datetime.fromisoformat("2024-07-20T18:00:00-03:00").replace(
tzinfo=ZoneInfo(settings.TIMEZONE)
),
location="Location 3",
description="Description 3",
link="https://example.com/events/3",
),
Event(
id=None,
identifier="4",
title="Event 4",
date_time=datetime.fromisoformat("2024-08-05T19:00:00-03:00").replace(
tzinfo=ZoneInfo(settings.TIMEZONE)
),
location="Location 4",
description="Description 4",
link="https://example.com/events/4",
),
]