def test_not_found(self, mocked_logger): """ Default HTTP 404 with errors """ base = BaseController() with pytest.raises(web.HTTPNotFound) as expected: base.not_found() mocked_logger.assert_called_once() assert expected.value.status == 404
def test_not_found_error(self): base = BaseController() base.not_found = MagicMock('aaa') base.handle_business_errors(ResourceNotFoundError()) base.not_found.assert_called_with()
async def test_not_found_error(self): base = BaseController() base.not_found = MagicMock('aaa') base.handle_service_errors(NotFoundError(404, '')) base.not_found.assert_called_with()