Beispiel #1
0
    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
Beispiel #2
0
    def test_not_found_error(self):
        base = BaseController()
        base.not_found = MagicMock('aaa')

        base.handle_business_errors(ResourceNotFoundError())

        base.not_found.assert_called_with()
Beispiel #3
0
    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()