'Test validate with an invalid encoding, e.g. LC_ALL=C.'

def test_validate_invalid_encoding(self, klass, os_mock, unicode_encode_err):

    os_mock.path.isfile.side_effect = unicode_encode_err
    os_mock.path.isabs.side_effect = unicode_encode_err
    with pytest.raises(configexc.ValidationError):
        klass().validate('foobar')
