forked from getpatchwork/pwclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfakes.py
More file actions
130 lines (118 loc) · 3.5 KB
/
fakes.py
File metadata and controls
130 lines (118 loc) · 3.5 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
"""Generate fake data from the XML-RPC API."""
def fake_patches():
return [
{
'id': 1157169,
'date': '2000-12-31 00:11:22',
'filename': '1-3--Drop-support-for-Python-3-4--add-Python-3-7',
'msgid': '<[email protected]>',
'name': '[1/3] Drop support for Python 3.4, add Python 3.7',
'project': 'my-project',
'project_id': 1,
'state': 'New',
'state_id': 1,
'archived': False,
'submitter': 'Joe Bloggs <[email protected]>',
'submitter_id': 1,
'delegate': 'admin',
'delegate_id': 1,
'commit_ref': '',
'hash': '',
},
{
'id': 1157170,
'date': '2000-12-31 00:11:22',
'filename': '2-3--docker--Simplify-MySQL-reset',
'msgid': '<[email protected]>',
'name': '[2/3] docker: Simplify MySQL reset',
'project': 'my-project',
'project_id': 1,
'state': 'Accepted',
'state_id': 3,
'archived': False,
'submitter': 'Joe Bloggs <[email protected]>',
'submitter_id': 1,
'delegate': 'admin',
'delegate_id': 1,
'commit_ref': '',
'hash': '',
},
{
'id': 1157168,
'date': '2000-12-31 00:11:22',
'filename': '3-3--docker--Use-pyenv-for-Python-versions',
'msgid': '<[email protected]>',
'name': '[3/3] docker: Use pyenv for Python versions',
'project': 'my-project',
'project_id': 1,
'state': 'Rejected',
'state_id': 4,
'archived': True,
'submitter': 'Joe Bloggs <[email protected]>',
'submitter_id': 1,
'delegate': 'admin',
'delegate_id': 1,
'commit_ref': '',
'hash': '',
},
]
def fake_people():
return [
{
'id': 1,
'name': 'Jeremy Kerr',
'email': '[email protected]',
},
{
'id': 4,
'name': 'Michael Ellerman',
'email': '[email protected]',
},
{
'id': 5,
'name': 'Kumar Gala',
'email': '[email protected]',
},
]
def fake_projects():
return [
{
'id': 1,
'name': 'Patchwork',
'linkname': 'patchwork',
'listid': 'patchwork.lists.ozlabs.org',
'listemail': '[email protected]',
},
]
def fake_checks():
return [
{
'id': 1,
'patch': 'A sample patch',
'patch_id': 1,
'user': 'Joe Bloggs',
'user_id': 1,
'state': 'success',
'target_url': 'https://example.com/',
'context': 'hello-world',
},
]
def fake_states():
return [
{
'id': 1,
'name': 'New',
}
]
def fake_events():
return [
{
'id': 1,
'category': 'series-completed',
'date': '2026-04-10T06:00:02',
'series_id': 499401,
'series_name': '[v3] growfiles: fix test failure',
'series_url': 'http://patchwork.ozlabs.org/api/series/499401/',
'series_mbox': 'http://patchwork.ozlabs.org/series/499401/mbox/',
},
]