Commits

Olemis Lang committed 06211ea

XmlRpcPlugin #10738 : Assertions for exceptions raised in ticket.create() ... ok

  • Participants
  • Parent commits 9b20aec
  • Branches t10738

Comments (0)

Files changed (1)

File t10738/t10738_r13203_ticket_create_validate.diff

 
 diff -r 44d0d9332c3f trunk/setup.py
 --- a/trunk/setup.py	Wed May 22 16:13:10 2013 +0200
-+++ b/trunk/setup.py	Tue Feb 18 12:36:15 2014 -0500
++++ b/trunk/setup.py	Tue Feb 18 12:59:52 2014 -0500
 @@ -19,7 +19,7 @@
  
  setup(
      author_email='alec@swapoff.org',
 diff -r 44d0d9332c3f trunk/tracrpc/tests/ticket.py
 --- a/trunk/tracrpc/tests/ticket.py	Wed May 22 16:13:10 2013 +0200
-+++ b/trunk/tracrpc/tests/ticket.py	Tue Feb 18 12:36:15 2014 -0500
++++ b/trunk/tracrpc/tests/ticket.py	Tue Feb 18 12:59:52 2014 -0500
 @@ -153,19 +153,19 @@
          t2 = self.admin.ticket.create("2", "", {'type': 'task', 'owner': 'B'})
          t3 = self.admin.ticket.create("3", "", {'type': 'defect', 'owner': 'A'})
                  self.admin.ticket.query("order=type&col=status&col=reporter"))
          # clean
          self.assertEquals(0, self.admin.ticket.delete(t1))
-@@ -373,6 +373,51 @@
+@@ -373,6 +373,60 @@
                            "</methodResponse>\n", response.read())
          self.admin.ticket.delete(1)
  
 +        t = self.admin.ticket.get(tid)
 +        self.assertFalse(t[3]['summary'].endswith('[VALID]'))
 +
-+        # Failures
-+        # TODO: Implement
++        # Invalid ticket submissions
++        e = self.assertRaises(xmlrpclib.Fault, self.user.ticket.create, 
++                          'Invalid user submission', 'Expected BOOM')
++        self.assertTrue('Detected BOOM in ticket description' in str(e))
++        e = self.assertRaises(xmlrpclib.Fault, self.user.ticket.create, 
++                          'Ignore validate arg in user submission',
++                          'Expected BOOM', {}, False, 0, False)
++        self.assertTrue('Detected BOOM in ticket description' in str(e))
++        e = self.assertRaises(xmlrpclib.Fault, self.admin.ticket.create, 
++                          'Invalid admin submission', 'Expected BOOM')
++        self.assertTrue('Detected BOOM in ticket description' in str(e))
 +
 +        # clean
 +        for tid in tickets:
      def setUp(self):
 diff -r 44d0d9332c3f trunk/tracrpc/ticket.py
 --- a/trunk/tracrpc/ticket.py	Wed May 22 16:13:10 2013 +0200
-+++ b/trunk/tracrpc/ticket.py	Tue Feb 18 12:36:15 2014 -0500
++++ b/trunk/tracrpc/ticket.py	Tue Feb 18 12:59:52 2014 -0500
 @@ -46,7 +46,8 @@
          yield ('TICKET_CREATE', ((int, str, str),
                                   (int, str, str, dict),