'Test with a relative path and standarddir.config returning None.'

@pytest.mark.parametrize('configtype,    value,    raises', [pytest.param(configtypes.File(), 'foobar', True, id='file-foobar'), pytest.param(configtypes.File(required=False), 'foobar', False, id='file-optional-foobar')])
def test_validate_rel_inexistent(self, os_mock, monkeypatch, configtype, value, raises):

    monkeypatch.setattr('qutebrowser.config.configtypes.standarddir.config', (lambda : 'this/does/not/exist'))
    os_mock.path.isabs.return_value = False
    os_mock.path.isfile.side_effect = os.path.isfile
    if raises:
        with pytest.raises(configexc.ValidationError):
            configtype.validate(value)
    else:
        configtype.validate(value)
