~cjohnston/uci-engine/1318774

« back to all changes in this revision

Viewing changes to cli/ci_cli/tests/test_get_ticket_status.py

  • Committer: Ubuntu CI Bot
  • Author(s): Andy Doan
  • Date: 2014-05-12 15:49:28 UTC
  • mfrom: (466.2.4 ts-model)
  • Revision ID: ubuntu_ci_bot-20140512154928-ng6cll5viw6ylgji
[r=PS Jenkins bot, Chris Johnston] ticket-api: simplify status values

Simplifies the TicketWorkflowStepStatus values to be consistent
and let the user infer the workflow-step using the "current_workflow_step"
attribute of a ticket.  from Andy Doan

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    def test_get_single_ticket_status(self, mock_urlopen):
36
36
        data = {
37
37
            "current_workflow_step": str(TicketWorkflowStep.IMAGE_BUILDING),
38
 
            "status": str(TicketWorkflowStepStatus.IMAGE_BUILDING_INPROGRESS),
 
38
            "status": str(TicketWorkflowStepStatus.INPROGRESS),
39
39
            "title": "My cool feature",
40
40
            "id": '100',
41
41
            "description": "my new feature",
62
62
                'Added binaries: mynewpackage\n'
63
63
                'Removed binaries: myoldpackage\n'.format(
64
64
                    str(TicketWorkflowStep.IMAGE_BUILDING),
65
 
                    str(TicketWorkflowStepStatus.IMAGE_BUILDING_INPROGRESS)),
 
65
                    str(TicketWorkflowStepStatus.INPROGRESS)),
66
66
                cm)
67
67
        mock_urlopen.assert_called_once()
68
68
 
70
70
    def test_get_ticket_status_unicode(self, mock_urlopen):
71
71
        data = {
72
72
            "current_workflow_step": str(TicketWorkflowStep.IMAGE_BUILDING),
73
 
            "status": str(TicketWorkflowStepStatus.IMAGE_BUILDING_INPROGRESS),
 
73
            "status": str(TicketWorkflowStepStatus.INPROGRESS),
74
74
            "title": "Testing unicode in title: joão",
75
75
            "id": '100',
76
76
            "description": "my new feature",
97
97
                'Added binaries: mynewpackage\n'
98
98
                'Removed binaries: myoldpackage\n'.format(
99
99
                    str(TicketWorkflowStep.IMAGE_BUILDING),
100
 
                    str(TicketWorkflowStepStatus.IMAGE_BUILDING_INPROGRESS)),
 
100
                    str(TicketWorkflowStepStatus.INPROGRESS)),
101
101
                cm)
102
102
        mock_urlopen.assert_called_once()
103
103
 
105
105
    def test_get_single_failed_ticket_status(self, mock_urlopen):
106
106
        data = {
107
107
            "current_workflow_step": str(TicketWorkflowStep.FAILED),
108
 
            "status": str(TicketWorkflowStepStatus.IMAGE_BUILDING_FAILED),
 
108
            "status": str(TicketWorkflowStepStatus.FAILED),
109
109
            "title": "My cool feature",
110
110
            "id": '100',
111
111
            "description": "my new feature",
131
131
                'Bug #: 12345\n'
132
132
                'Added binaries: mynewpackage\n'
133
133
                'Removed binaries: myoldpackage\n'.format(
134
 
                    str(TicketWorkflowStepStatus.IMAGE_BUILDING_FAILED)),
 
134
                    str(TicketWorkflowStepStatus.FAILED)),
135
135
                cm)
136
136
        mock_urlopen.assert_called_once()
137
137