def test_interface(self): """ Ensure that the returned status object implements the correct interface. """ s = status.error(None, None) self.assertTrue(status.IStatus.providedBy(s))
def test_return(self): """ Check the attribute allocation. """ s = status.error('foo', 'bar', spam='eggs', gak=[1, 2, 3]) # core attributes self.assertEqual(s.level, 'error') self.assertEqual(s.code, 'foo') self.assertEqual(s.description, 'bar') # extra context self.assertEqual(s.spam, 'eggs') self.assertEqual(s.gak, [1, 2, 3])