def read(): """ :return dict: :raise: UserDoesNotExistException """ user_name = request.args.get('name') user_bean = UserBusiness.read(user_name) return user_bean.to_dict()
def test_read_nonexistent_user(self): with self.assertRaises(UserDoesNotExistException) as context: UserBusiness.read(None) self.assertIsInstance(context.exception, UserDoesNotExistException)
def test_read(self): user_bean = UserBusiness.read(self.user_name) self.assertIsInstance(user_bean, UserBean)