|
4 | 4 |
|
5 | 5 | Tests for the user cli command |
6 | 6 | """ |
| 7 | +import json |
| 8 | + |
7 | 9 | from SoftLayer.fixtures import SoftLayer_Account as SoftLayer_Account |
8 | 10 | from SoftLayer import testing |
9 | 11 |
|
@@ -37,8 +39,20 @@ def test_event_ack_all(self): |
37 | 39 | self.assert_called_with(self.SLNOE, 'getAllObjects') |
38 | 40 | self.assert_called_with(self.SLNOE, 'acknowledgeNotification', identifier=1234) |
39 | 41 |
|
40 | | - # slcli account invoice-detail |
| 42 | + def test_event_jsonraw_output(self): |
| 43 | + # https://github.com/softlayer/softlayer-python/issues/1545 |
| 44 | + command = '--format jsonraw account events' |
| 45 | + command_params = command.split() |
| 46 | + result = self.run_command(command_params) |
| 47 | + json_text_tables = result.stdout.split('\n') |
| 48 | + # removing an extra item due to an additional Newline at the end of the output |
| 49 | + json_text_tables.pop() |
| 50 | + # each item in the json_text_tables should be a list |
| 51 | + for json_text_table in json_text_tables: |
| 52 | + json_table = json.loads(json_text_table) |
| 53 | + self.assertIsInstance(json_table, list) |
41 | 54 |
|
| 55 | + # slcli account invoice-detail |
42 | 56 | def test_invoice_detail(self): |
43 | 57 | result = self.run_command(['account', 'invoice-detail', '1234']) |
44 | 58 | self.assert_no_fail(result) |
|
0 commit comments