~benji/lazr.restful/bug-413174

« back to all changes in this revision

Viewing changes to src/lazr/restful/tests/test_error.py

  • Committer: Benji York
  • Date: 2010-09-01 21:47:10 UTC
  • Revision ID: benji.york@canonical.com-20100901214710-dqde7moidbmzty83
change the way expose checks its argument and add tests for it

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
        # of the response.
94
94
        self.assert_(result.startswith('something broke'))
95
95
 
 
96
    def test_passing_bad_things_to_expose(self):
 
97
        # The expose function only accepts instances of exceptions.  It
 
98
        # generates errors otherwise.
 
99
        self.assertRaises(ValueError, expose, 1)
 
100
        self.assertRaises(ValueError, expose, 'x')
 
101
        self.assertRaises(ValueError, expose, RuntimeError)
 
102
 
96
103
 
97
104
class FunctionalLayer:
98
105
    allow_teardown = False