-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
84 lines (78 loc) · 2.81 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
74
75
76
77
78
79
80
81
82
83
84
from typing import Any, Dict, List
from pypocket.pocket_dataclass import PocketItem
from pypocket.utils import convert_epoch_to_utc_datetime
# @pytest.fixture()
def sample_response() -> Dict[str, Any]:
fake_response_get = {
"123": {
"item_id": "123",
"resolved_id": "123",
"given_url": "https://google.com",
"given_title": "",
"favorite": "0",
"status": "0",
"time_added": "1611279297",
"time_updated": "1611279297",
"time_read": "0",
"time_favorited": "0",
"sort_id": 0,
"resolved_title": "This is the title of post 1",
"resolved_url": "https://google.com",
"excerpt": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"is_article": "1",
"is_index": "0",
"has_video": "0",
"has_image": "1",
"word_count": "100",
"lang": "en",
"time_to_read": 3,
},
"456": {
"item_id": "456",
"resolved_id": "456",
"given_url": "https://abc.xyz",
"given_title": "",
"favorite": "0",
"status": "0",
"time_added": "1611120874",
"time_updated": "1611205801",
"time_read": "0",
"time_favorited": "0",
"sort_id": 0,
"resolved_title": "This is the title of post 2",
"resolved_url": "https://abc.xyz",
"excerpt": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"is_article": "1",
"is_index": "0",
"has_video": "0",
"has_image": "1",
"word_count": "200",
"lang": "en",
"time_to_read": 5,
"tags": {
"python": {"item_id": "456", "tag": "python"},
"modeling": {"item_id": "456", "tag": "modeling"},
},
},
}
return fake_response_get
# @pytest.fixture()
def sample_list_pocket_items() -> List[PocketItem]:
return [
PocketItem(
item_id=123,
title="This is the title of post 1",
url="https://google.com",
tags=[],
time_added=convert_epoch_to_utc_datetime(1611279297),
time_updated=convert_epoch_to_utc_datetime(1611279297),
),
PocketItem(
item_id=456,
title="This is the title of post 2",
url="https://abc.xyz",
tags=["python", "modeling"],
time_added=convert_epoch_to_utc_datetime(1611120874),
time_updated=convert_epoch_to_utc_datetime(1611205801),
),
]