Skip to content

Commit c2ab8cb

Browse files
committed
Test bad number path for ShowAction action.
1 parent f5f2983 commit c2ab8cb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/test_actions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ def testShowActionNoType(self):
8282
self.assertRaisesMessage(ValueError, action.handle,
8383
'No type specified')
8484

85+
def testShowActionBadNumber(self):
86+
action = ShowAction(self.client)
87+
self.assertRaises(ValueError, action.handle)
88+
self.form.value.append(MiniFieldStorage('@number', 'A'))
89+
self.form.value.append(MiniFieldStorage('@type', 'issue'))
90+
with self.assertRaises(SeriousError) as ctx:
91+
action.handle()
92+
self.assertEqual('"A" is not an ID (issue ID required)',
93+
ctx.exception.args[0])
94+
8595
class RetireActionTestCase(ActionTestCase):
8696
def testRetireAction(self):
8797
self.client.db.security.hasPermission = true

0 commit comments

Comments
 (0)