class HandlerValidatorTestCase(unittest.TestCase): def setUp(self): super(HandlerValidatorTestCase, self).setUp() self.validator = HandlerValidator() def test_check_handler(self): valid_handler = MethodBasedView self.assertIsNone(self.validator.validate(valid_handler)) def test_check_handler_failed(self): invalid_handler = object self.assertRaises(InvalidHandler, self.validator.validate, invalid_handler) def test_check_handler_failed_2(self): invalid_handler = [ 'not a class', ] self.assertRaises(InvalidHandler, self.validator.validate, invalid_handler)
class HandlerValidatorTestCase(unittest.TestCase): def setUp(self): super(HandlerValidatorTestCase, self).setUp() self.validator = HandlerValidator() def test_check_handler(self): valid_handler = MethodBasedView self.assertIsNone(self.validator.validate(valid_handler)) def test_check_handler_failed(self): invalid_handler = object self.assertRaises( InvalidHandler, self.validator.validate, invalid_handler ) def test_check_handler_failed_2(self): invalid_handler = ['not a class', ] self.assertRaises( InvalidHandler, self.validator.validate, invalid_handler )
def setUp(self): super(HandlerValidatorTestCase, self).setUp() self.validator = HandlerValidator()