Skip to content

Commit 474e338

Browse files
Merge pull request #989 from fmiquiza/issue#977
Issue#977
2 parents 07ee664 + e834590 commit 474e338

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

SoftLayer/managers/ticket.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
:license: MIT, see LICENSE for more details.
77
"""
8-
98
from SoftLayer import utils
109

1110

@@ -38,6 +37,8 @@ def list_tickets(self, open_status=True, closed_status=True):
3837
call = 'getOpenTickets'
3938
elif closed_status:
4039
call = 'getClosedTickets'
40+
else:
41+
raise ValueError("open_status and closed_status cannot both be False")
4142

4243
return self.client.call('Account', call, mask=mask)
4344

tests/managers/ticket_tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ def test_list_tickets_closed(self):
4343
self.assertIn(result['id'], [100, 101])
4444
self.assert_called_with('SoftLayer_Account', 'getClosedTickets')
4545

46+
def test_list_tickets_false(self):
47+
exception = self.assertRaises(ValueError,
48+
self.ticket.list_tickets,
49+
open_status=False,
50+
closed_status=False)
51+
52+
self.assertEqual('open_status and closed_status cannot both be False', str(exception))
53+
4654
def test_list_subjects(self):
4755
list_expected_ids = [1001, 1002, 1003, 1004, 1005]
4856

0 commit comments

Comments
 (0)