Example #1
0
    def test_no_request_factory_error(self, mock_validate):
        spec = mock.sentinel.spec
        request = mock.sentinel.request
        mock_validate.return_value = ResultMock(error_to_raise=ValueError)

        with pytest.raises(ValueError):
            spec_validate_parameters(spec, request)

        mock_validate.aasert_called_once_with(request)
Example #2
0
    def test_no_request_factory(self, mock_validate):
        spec = mock.sentinel.spec
        request = mock.sentinel.request
        parameters = mock.sentinel.parameters
        mock_validate.return_value = ResultMock(parameters=parameters)

        result = spec_validate_parameters(spec, request)

        assert result == parameters
        mock_validate.aasert_called_once_with(request)