-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add tests for JIRA input translation & update TODO
- Loading branch information
Showing
4 changed files
with
311 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,53 @@ | |
|
||
|
||
fake_fields = [ | ||
{'clauseNames': ['priority', 'Priority'], | ||
'custom': False, | ||
'id': 'priority', | ||
'name': 'Priority', | ||
'schema': {'system': 'priority', 'type': 'priority'}, | ||
'allowedValues': [ | ||
{'id': 101, | ||
'name': 'Blocker'}, | ||
{'id': 102, | ||
'name': 'Critical'}, | ||
{'id': 103, | ||
'name': 'Major'}, | ||
{'id': 104, | ||
'name': 'Normal'}, | ||
{'id': 105, | ||
'name': 'Minor'}, | ||
{'id': 106, | ||
'name': 'Undefined'}], | ||
'defaultValue': {'id': 104, 'name': 'Normal'}, | ||
'hasDefaultValue': True, | ||
'operations': ['set'] | ||
}, | ||
{'clauseNames': ['description', 'Description'], | ||
'custom': False, | ||
'name': 'Description', | ||
'id': 'description', | ||
'required': True, | ||
'operations': ['set'], | ||
'schema': {'type': 'string'}, | ||
}, | ||
{'clauseNames': ['components', 'Component/s'], | ||
'custom': False, | ||
'id': 'components', | ||
'name': 'Component/s', | ||
'schema': {'system': 'items', 'type': 'array', 'items': 'component'}, | ||
'allowedValues': [ | ||
{'id': 1001, | ||
'name': 'python'}, | ||
{'id': 1002, | ||
'name': 'kernel'}, | ||
{'id': 1003, | ||
'name': 'glibc'}, | ||
{'id': 1004, | ||
'name': 'porkchop'}], | ||
'operations': ['add', 'set', 'remove'], | ||
'required': True | ||
}, | ||
{'clauseNames': ['cf[1234567]', 'Fixed in Build'], | ||
'custom': True, | ||
'id': 'customfield_1234567', | ||
|
@@ -17,6 +64,7 @@ | |
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:textfield', | ||
'customId': 1234567, | ||
'type': 'string'}, | ||
'operations': ['set'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234568]', 'Score'], | ||
'custom': True, | ||
|
@@ -27,6 +75,7 @@ | |
'schema': {'custom': 'org.jboss.labs.jira.plugin.jboss-custom-field-types-plugin:jbonlynumber', | ||
'customId': 1234568, | ||
'type': 'number'}, | ||
'operations': ['set'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234569]', 'Array of Options'], | ||
'custom': True, | ||
|
@@ -38,6 +87,15 @@ | |
'customId': 1234569, | ||
'items': 'option', | ||
'type': 'array'}, | ||
'allowedValues': [ | ||
{'value': 'One', | ||
'id': '1'}, | ||
{'value': 'Two', | ||
'id': '2'}, | ||
{'value': 'Three', | ||
'id': '3'} | ||
], | ||
'operations': ['add', 'set', 'remove'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234570]', 'Array of Versions'], | ||
'custom': True, | ||
|
@@ -49,6 +107,13 @@ | |
'customId': 1234570, | ||
'items': 'version', | ||
'type': 'array'}, | ||
'allowedValues': [ | ||
{'name': '1.0.1', | ||
'id': '11'}, | ||
{'name': '1.0.2', | ||
'id': '12'} | ||
], | ||
'operations': ['add', 'set', 'remove'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234571]', 'Array of Users'], | ||
'custom': True, | ||
|
@@ -60,6 +125,7 @@ | |
'customId': 1234571, | ||
'items': 'user', | ||
'type': 'array'}, | ||
'operations': ['add', 'set', 'remove'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234572]', 'Array of Strings'], | ||
'custom': True, | ||
|
@@ -71,6 +137,7 @@ | |
'customId': 1234572, | ||
'items': 'string', | ||
'type': 'array'}, | ||
'operations': ['add', 'set', 'remove'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234573]', 'Array of Groups'], | ||
'custom': True, | ||
|
@@ -92,6 +159,7 @@ | |
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', | ||
'customId': 1234574, | ||
'type': 'any'}, | ||
'operations': ['add', 'set', 'remove'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234575]', 'Date Value'], | ||
'custom': True, | ||
|
@@ -102,6 +170,7 @@ | |
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', | ||
'customId': 1234575, | ||
'type': 'date'}, | ||
'operations': ['set'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234576]', 'Datetime Value'], | ||
'custom': True, | ||
|
@@ -112,6 +181,7 @@ | |
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', | ||
'customId': 1234576, | ||
'type': 'datetime'}, | ||
'operations': ['set'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234577]', 'Related Issue'], | ||
'custom': True, | ||
|
@@ -122,13 +192,23 @@ | |
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', | ||
'customId': 1234577, | ||
'type': 'issuelinks'}, | ||
'operations': ['set'], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234578]', 'Option Value'], | ||
'custom': True, | ||
'id': 'customfield_1234578', | ||
'name': 'Option Value', | ||
'navigable': True, | ||
'orderable': True, | ||
'operations': ['set'], | ||
'allowedValues': [ | ||
{'value': 'One', | ||
'id': '1'}, | ||
{'value': 'Two', | ||
'id': '2'}, | ||
{'value': 'Three', | ||
'id': '3'} | ||
], | ||
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', | ||
'customId': 1234578, | ||
'type': 'option'}, | ||
|
@@ -142,6 +222,14 @@ | |
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', | ||
'customId': 1234579, | ||
'type': 'option-with-child'}, | ||
'allowedValues': [ | ||
{'value': 'One', | ||
'id': '1'}, | ||
{'value': 'Two', | ||
'id': '2'}, | ||
{'value': 'Three', | ||
'id': '3'} | ||
], | ||
'searchable': True}, | ||
{'clauseNames': ['cf[1234580]', 'User Value'], | ||
'custom': True, | ||
|
@@ -162,11 +250,20 @@ | |
'schema': {'custom': 'com.atlassian.jira.plugin.system.customfieldtypes:multiselect', | ||
'customId': 1234581, | ||
'type': 'version'}, | ||
'allowedValues': [ | ||
{'name': '1.0.1', | ||
'id': '11'}, | ||
{'name': '1.0.2', | ||
'id': '12'} | ||
], | ||
'searchable': True} | ||
|
||
] | ||
|
||
|
||
fake_metadata = {val['id']: val for val in fake_fields} | ||
|
||
|
||
fake_issues = { | ||
'TEST-1': {'expand': 'renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations', | ||
'fields': {'aggregateprogress': {'progress': 0, 'total': 0}, | ||
|
@@ -199,9 +296,7 @@ | |
'subtask': False}, | ||
'labels': ['label1', 'label2'], | ||
'lastViewed': '2023-11-22T15:51:50.281+0000', | ||
'priority': {'id': '10200', | ||
'name': 'Normal', | ||
'self': 'https://domain.com/rest/api/2/priority/10200'}, | ||
'priority': {'id': '104', 'name': 'Normal'}, | ||
'progress': {'progress': 0, 'total': 0}, | ||
'project': {'id': '1234', | ||
'key': 'TEST', | ||
|
@@ -312,63 +407,60 @@ | |
'subtask': False}, | ||
'labels': ['label2'], | ||
'lastViewed': '2023-11-22T15:51:50.281+0000', | ||
'priority': { | ||
'id': '10200', | ||
'name': 'Normal', | ||
'self': 'https://domain.com/rest/api/2/priority/10200'}, | ||
'progress': {'progress': 0, 'total': 0}, | ||
'project': {'id': '1234', | ||
'key': 'TEST', | ||
'name': 'Test Project', | ||
'projectCategory': {'description': 'Test Projects', | ||
'id': '1073', | ||
'name': 'Projecto', | ||
'self': 'https://domain.com/rest/api/2/projectCategory/1073'}, | ||
'projectTypeKey': 'software', | ||
'self': 'https://domain.com/rest/api/2/project/1234'}, | ||
'reporter': {'active': True, | ||
'displayName': 'Pork Chop', | ||
'emailAddress': '[email protected]', | ||
'key': 'JIRAUSER1', | ||
'name': '[email protected]', | ||
'self': 'https://domain.com/rest/api/2/user?username=pchop%40domain.com', | ||
'timeZone': 'Asia/Kolkata'}, | ||
'resolution': None, | ||
'resolutiondate': None, | ||
'security': None, | ||
'status': {'description': 'Initial creation status. ', | ||
'id': '10', | ||
'name': 'New', | ||
'self': 'https://domain.com/rest/api/2/status/10016', | ||
'statusCategory': {'colorName': 'default', | ||
'id': 2, | ||
'key': 'new', | ||
'name': 'To Do', | ||
'self': 'https://domain.com/rest/api/2/statuscategory/2'}}, | ||
'subtasks': [], | ||
'summary': 'Test 1', | ||
'timeestimate': None, | ||
'timeoriginalestimate': None, | ||
'timespent': None, | ||
'timetracking': {}, | ||
'updated': '2023-11-30T15:06:39.875+0000', | ||
'versions': [{'archived': False, | ||
'description': '', | ||
'id': '6', | ||
'name': 'version-6', | ||
'released': False, | ||
'self': 'https://domain.com/rest/api/2/version/6'}], | ||
'votes': {'hasVoted': False, | ||
'self': 'https://domain.com/rest/api/2/issue/TEST-1/votes', | ||
'votes': 0}, | ||
'watches': {'isWatching': False, | ||
'self': 'https://domain.com/rest/api/2/issue/TEST-1/watchers', | ||
'watchCount': 2}, | ||
'worklog': {'maxResults': 20, | ||
'startAt': 0, | ||
'total': 0, | ||
'worklogs': []}, | ||
'workratio': -1}, | ||
'priority': {'id': 104, 'name': 'Normal'}, | ||
'progress': {'progress': 0, 'total': 0}, | ||
'project': {'id': '1234', | ||
'key': 'TEST', | ||
'name': 'Test Project', | ||
'projectCategory': {'description': 'Test Projects', | ||
'id': '1073', | ||
'name': 'Projecto', | ||
'self': 'https://domain.com/rest/api/2/projectCategory/1073'}, | ||
'projectTypeKey': 'software', | ||
'self': 'https://domain.com/rest/api/2/project/1234'}, | ||
'reporter': {'active': True, | ||
'displayName': 'Pork Chop', | ||
'emailAddress': '[email protected]', | ||
'key': 'JIRAUSER1', | ||
'name': '[email protected]', | ||
'self': 'https://domain.com/rest/api/2/user?username=pchop%40domain.com', | ||
'timeZone': 'Asia/Kolkata'}, | ||
'resolution': None, | ||
'resolutiondate': None, | ||
'security': None, | ||
'status': {'description': 'Initial creation status. ', | ||
'id': '10', | ||
'name': 'New', | ||
'self': 'https://domain.com/rest/api/2/status/10016', | ||
'statusCategory': {'colorName': 'default', | ||
'id': 2, | ||
'key': 'new', | ||
'name': 'To Do', | ||
'self': 'https://domain.com/rest/api/2/statuscategory/2'}}, | ||
'subtasks': [], | ||
'summary': 'Test 1', | ||
'timeestimate': None, | ||
'timeoriginalestimate': None, | ||
'timespent': None, | ||
'timetracking': {}, | ||
'updated': '2023-11-30T15:06:39.875+0000', | ||
'versions': [{'archived': False, | ||
'description': '', | ||
'id': '6', | ||
'name': 'version-6', | ||
'released': False, | ||
'self': 'https://domain.com/rest/api/2/version/6'}], | ||
'votes': {'hasVoted': False, | ||
'self': 'https://domain.com/rest/api/2/issue/TEST-1/votes', | ||
'votes': 0}, | ||
'watches': {'isWatching': False, | ||
'self': 'https://domain.com/rest/api/2/issue/TEST-1/watchers', | ||
'watchCount': 2}, | ||
'worklog': {'maxResults': 20, | ||
'startAt': 0, | ||
'total': 0, | ||
'worklogs': []}, | ||
'workratio': -1}, | ||
'id': '1000002', | ||
'key': 'TEST-2', | ||
'self': 'https://domain.com/rest/api/2/issue/1000002'} | ||
|
Oops, something went wrong.