Example #1
0
 def test_attach_exc_details_with_dict_interpolation(self):
     e = Exception()
     utils.attach_exc_details(e, 'details: %(foo)s, %(bar)s', {
         'foo': 'foo',
         'bar': 'bar'
     })
     self.assertEqual('details: foo, bar', utils.extract_exc_details(e))
Example #2
0
 def test_attach_exc_details_with_None_interpolation(self):
     e = Exception()
     utils.attach_exc_details(e, 'details: %s', None)
     self.assertEqual('details: %s' % str(None),
                      utils.extract_exc_details(e))
Example #3
0
 def test_attach_exc_details_with_multiple_interpolation(self):
     e = Exception()
     utils.attach_exc_details(e, 'details: %s, %s', ('foo', 'bar'))
     self.assertEqual('details: foo, bar', utils.extract_exc_details(e))
Example #4
0
 def test_attach_exc_details(self):
     e = Exception()
     utils.attach_exc_details(e, 'details')
     self.assertEqual('details', utils.extract_exc_details(e))
Example #5
0
 def test_attach_exc_details_with_interpolation(self):
     e = Exception()
     utils.attach_exc_details(e, 'details: %s', 'foo')
     self.assertEqual('details: foo', utils.extract_exc_details(e))
Example #6
0
 def test_attach_exc_details_with_multiple_interpolation(self):
     e = Exception()
     utils.attach_exc_details(
         e, 'details: %s, %s', ('foo', 'bar'))
     self.assertEqual('details: foo, bar', utils.extract_exc_details(e))
Example #7
0
 def test_attach_exc_details_with_dict_interpolation(self):
     e = Exception()
     utils.attach_exc_details(
         e, 'details: %(foo)s, %(bar)s', {'foo': 'foo', 'bar': 'bar'})
     self.assertEqual('details: foo, bar', utils.extract_exc_details(e))
Example #8
0
 def test_attach_exc_details_with_None_interpolation(self):
     e = Exception()
     utils.attach_exc_details(e, 'details: %s', None)
     self.assertEqual(
         'details: %s' % str(None), utils.extract_exc_details(e))
Example #9
0
 def test_attach_exc_details_with_interpolation(self):
     e = Exception()
     utils.attach_exc_details(e, 'details: %s', 'foo')
     self.assertEqual('details: foo', utils.extract_exc_details(e))
Example #10
0
 def test_attach_exc_details(self):
     e = Exception()
     utils.attach_exc_details(e, 'details')
     self.assertEqual('details', utils.extract_exc_details(e))
Example #11
0
 def test_unhandled_error_logs_attached_details(self):
     e = Exception()
     utils.attach_exc_details(e, 'attached_details')
     self._test_unhandled_error_logs_details(e, 'attached_details')
Example #12
0
 def test_unhandled_error_logs_attached_details(self):
     e = Exception()
     utils.attach_exc_details(e, 'attached_details')
     self._test_unhandled_error_logs_details(e, 'attached_details')