Debian Codegraph @

tests/__init__.py

raw
1 """Setup for tests."""
2
3 from typing import Final
4
5 ORGANIZATION: Final[str] = "testorg"
6 PROJECT: Final[str] = "testproject"
7 PAT: Final[str] = "testpat"
8
9
10 RESPONSE_JSON_BASIC: Final[dict] = {"test": "test"}
11
12 RESPONSE_JSON_DEVOPS_PROJECT: Final[dict] = {
13 "id": "testid",
14 "name": "testname",
15 "description": "testdescription",
16 "url": "testurl",
17 "state": "teststate",
18 "capabilities": {
19 "processTemplate": {
20 "templateName": "Agile",
21 "templateTypeId": "abc123-abc1-abc1-abc1-abc123456789",
22 },
23 "versioncontrol": {
24 "sourceControlType": "Git",
25 "gitEnabled": "True",
26 "tfvcEnabled": "False",
27 },
28 },
29 "revision": 1,
30 "visibility": "testvisibility",
31 "lastUpdated": None,
32 "defaultTeam": {
33 "id": "testid",
34 "name": "testname",
35 "url": "testurl",
36 },
37 "_links": {
38 "self": {"href": "testself"},
39 "collection": {"href": "testcollection"},
40 "web": {"href": "testweb"},
41 },
42 }
43
44
45 RESPONSE_JSON_DEVOPS_BUILD_DEFINITION: Final[dict] = {
46 "id": 1,
47 "name": "testname",
48 "url": "testurl",
49 "path": "testpath",
50 "type": "testtype",
51 "queueStatus": "testqueuestatus",
52 "revision": 1,
53 }
54
55 RESPONSE_JSON_DEVOPS_BUILD: Final[dict] = {
56 "id": 1,
57 "buildNumber": "testbuildnumber",
58 "status": "teststatus",
59 "result": "testresult",
60 "sourceBranch": "testsourcebranch",
61 "sourceVersion": "testsourceversion",
62 "priority": "testpriority",
63 "reason": "testreason",
64 "queueTime": "testqueuetime",
65 "startTime": "teststarttime",
66 "finishTime": "testfinishtime",
67 "definition": RESPONSE_JSON_DEVOPS_BUILD_DEFINITION,
68 "project": RESPONSE_JSON_DEVOPS_PROJECT,
69 "_links": {
70 "self": {"href": "testself"},
71 "web": {"href": "testweb"},
72 "sourceVersionDisplayUri": {"href": "testsourceversiondisplayuri"},
73 "timeline": {"href": "testtimeline"},
74 "badge": {"href": "testbadge"},
75 },
76 }
77
78
79 RESPONSE_JSON_DEVOPS_BUILDS: Final[dict] = {"value": [RESPONSE_JSON_DEVOPS_BUILD]}
80
81 RESPONSE_JSON_DEVOPS_WIQL_WORK_ITEM: Final[dict] = {
82 "id": 1,
83 "url": "testurl",
84 }
85
86 RESPONSE_JSON_DEVOPS_ITERATION: Final[dict] = {
87 "id": "abc123",
88 "name": "Sprint 2",
89 "path": "testname\\Sprint 2",
90 "attributes": {
91 "startDate": "2021-01-01T00:00:00Z",
92 "finishDate": "2021-01-31T00:00:00Z",
93 "timeFrame": "current",
94 },
95 "url": "testurl",
96 }
97
98 RESPONSE_JSON_DEVOPS_ITERATIONS: Final[dict] = {
99 "count": 1,
100 "value": [
101 {
102 "id": "abc123",
103 "name": "Sprint 1",
104 "path": "testname\\Sprint 1",
105 "attributes": {
106 "startDate": "2021-01-01T00:00:00Z",
107 "finishDate": "2021-01-31T00:00:00Z",
108 "timeFrame": "past",
109 },
110 "url": "testurl",
111 },
112 RESPONSE_JSON_DEVOPS_ITERATION,
113 {
114 "id": "abc123",
115 "name": "Sprint 3",
116 "path": "testname\\Sprint 3",
117 "attributes": {
118 "startDate": "2021-01-01T00:00:00Z",
119 "finishDate": "2021-01-31T00:00:00Z",
120 "timeFrame": "future",
121 },
122 "url": "testurl",
123 },
124 ],
125 }
126
127 RESPONSE_JSON_DEVOPS_ITERATION_WORK_ITEMS: Final[dict] = {
128 "workItemRelations": [
129 {"rel": None, "source": None, "target": {"id": 1, "url": "testurl"}}
130 ],
131 "url": "testurl",
132 }
133
134 RESPONSE_JSON_DEVOPS_WIQL_RESULT: Final[dict] = {
135 "queryType": "testqueryType",
136 "queryResultType": "testqueryResultType",
137 "asOf": "testasOf",
138 "columns": [
139 {
140 "referenceName": "testreferenceName",
141 "name": "testname",
142 "url": None,
143 }
144 ],
145 "workItems": [RESPONSE_JSON_DEVOPS_WIQL_WORK_ITEM],
146 }
147
148 RESPONSE_JSON_DEVOPS_WORK_ITEM: Final[dict] = {
149 "id": 1,
150 "rev": 234,
151 "fields": {
152 "System.Id": 1,
153 "System.Title": "testTitle",
154 "System.AreaPath": "testAreaPath",
155 "System.TeamProject": "testTeamProject",
156 "System.IterationPath": "testIterationPath",
157 "System.WorkItemType": "testWorkItemType",
158 "System.State": "testState",
159 "System.Reason": "testReason",
160 "System.CreatedDate": "testCreatedDate",
161 "System.ChangedDate": "testChangedDate",
162 "System.CommentCount": 1,
163 "Microsoft.VSTS.Common.Priority": 1,
164 },
165 "url": "testurl",
166 }
167
168 RESPONSE_JSON_DEVOPS_WORK_ITEMS: Final[dict] = {
169 "count": 1,
170 "value": [
171 RESPONSE_JSON_DEVOPS_WORK_ITEM,
172 ],
173 }
174
175 RESPONSE_JSON_DEVOPS_WORK_ITEM_TYPES: Final[dict] = {
176 "count": 1,
177 "value": [
178 {
179 "name": "testname",
180 "referenceName": "testreferenceName",
181 "description": "testdescription",
182 "color": "testcolor",
183 "icon": {
184 "id": "testid",
185 "url": "testurl",
186 },
187 "isDisabled": False,
188 "xmlForm": "testxmlForm",
189 "fields": [],
190 "fieldInstances": [],
191 "transitions": {},
192 "states": [
193 {"name": "New", "color": "b2b2b2", "category": "Proposed"},
194 {"name": "On Hold", "color": "fcfea8", "category": "InProgress"},
195 {"name": "Ready", "color": "007acc", "category": "InProgress"},
196 {"name": "In Development", "color": "e87025", "category": "InProgress"},
197 {"name": "In Code Review", "color": "f9b978", "category": "InProgress"},
198 {"name": "In Test", "color": "fbd144", "category": "InProgress"},
199 {"name": "In UAT", "color": "71338d", "category": "InProgress"},
200 {"name": "In PreProd", "color": "ef33a3", "category": "InProgress"},
201 {
202 "name": "Ready for Release",
203 "color": "207752",
204 "category": "InProgress",
205 },
206 {"name": "Released", "color": "c3d84c", "category": "Resolved"},
207 {"name": "Closed", "color": "339933", "category": "Completed"},
208 ],
209 "url": "testurl",
210 }
211 ],
212 }