Esempio n. 1
0
 def test_add_cc(self, mock_session, mock_content):
     mock_session.return_value = FakeSession()
     ticket = bugzilla.BugzillaTicket(URL, PROJECT, ticket_id=TICKET_ID)
     t = ticket.add_cc('')
     self.assertEqual(t, mock_content.return_value)
Esempio n. 2
0
 def test_add_cc_error(self, mock_session):
     mock_session.return_value = FakeSession(status_code=401)
     ticket = bugzilla.BugzillaTicket(URL, PROJECT, ticket_id=TICKET_ID)
     t = ticket.add_cc('')
     self.assertEqual(t, RETURN_RESULT('Failure', 'There is some error.', TICKET_URL, None))
Esempio n. 3
0
 def test_add_cc_unexpected_response(self, mock_session, mock_id, mock_project):
     mock_session.return_value = FakeSession(status_code=400)
     ticket = bugzilla.BugzillaTicket(URL, PROJECT, ticket_id=TICKET_ID)
     t = ticket.add_cc('')
     self.assertEqual(t, RETURN_RESULT('Failure', '', TICKET_URL, None))
Esempio n. 4
0
 def test_add_cc_bugs(self, mock_session):
     mock_session.return_value = FakeSession(status_code=402)
     ticket = bugzilla.BugzillaTicket(URL, PROJECT, ticket_id=TICKET_ID)
     t = ticket.add_cc('')
     self.assertEqual(t, SUCCESS_RESULT._replace(url=TICKET_URL))
Esempio n. 5
0
 def test_add_cc_no_id(self, mock_session):
     mock_session.return_value = FakeSession()
     ticket = bugzilla.BugzillaTicket(URL, PROJECT)
     t = ticket.add_cc('')
     self.assertEqual(t, FAILURE_RESULT._replace(error_message=ERROR_MESSAGE))