|
1 | 1 | """ |
2 | 2 | SoftLayer.tests.CLI.modules.ticket_tests |
3 | 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4 | | -
|
5 | 4 | :license: MIT, see LICENSE for more details. |
6 | 5 | """ |
7 | 6 | import json |
@@ -43,8 +42,8 @@ def test_detail(self): |
43 | 42 | 'status': 'Closed', |
44 | 43 | 'title': 'Cloud Instance Cancellation - 08/01/13', |
45 | 44 | 'update 1': 'a bot says something', |
46 | | - 'update 2': 'By John Smith\nuser says something', |
47 | | - 'update 3': 'By emp1 (Employee)\nemployee says something', |
| 45 | + 'update 2': 'By John Smith user says something', |
| 46 | + 'update 3': 'By emp1 (Employee) employee says something', |
48 | 47 | } |
49 | 48 | self.assert_no_fail(result) |
50 | 49 | self.assertEqual(json.loads(result.output), expected) |
@@ -300,3 +299,18 @@ def test_ticket_update_no_body(self, edit_mock): |
300 | 299 | result = self.run_command(['ticket', 'update', '100']) |
301 | 300 | self.assert_no_fail(result) |
302 | 301 | self.assert_called_with('SoftLayer_Ticket', 'addUpdate', args=({'entry': 'Testing1'},), identifier=100) |
| 302 | + |
| 303 | + def test_ticket_json(self): |
| 304 | + result = self.run_command(['--format=json', 'ticket', 'detail', '1']) |
| 305 | + expected = {'Case_Number': 'CS123456', |
| 306 | + 'created': '2013-08-01T14:14:04-07:00', |
| 307 | + 'edited': '2013-08-01T14:16:47-07:00', |
| 308 | + 'id': 100, |
| 309 | + 'priority': 'No Priority', |
| 310 | + 'status': 'Closed', |
| 311 | + 'title': 'Cloud Instance Cancellation - 08/01/13', |
| 312 | + 'update 1': 'a bot says something', |
| 313 | + 'update 2': 'By John Smith user says something', |
| 314 | + 'update 3': 'By emp1 (Employee) employee says something'} |
| 315 | + self.assert_no_fail(result) |
| 316 | + self.assertEqual(json.loads(result.output), expected) |
0 commit comments