def test_matches_regex():
    'Test matches_regex validator.'
    schema = vol.Schema(cv.matches_regex('.*uiae.*'))
    with pytest.raises(vol.Invalid):
        schema(1.0)
    with pytest.raises(vol.Invalid):
        schema('  nrtd   ')
    test_str = 'This is a test including uiae.'
    assert (schema(test_str) == test_str)
Test matches_regex validator.
def test_matches_regex():
    
    schema = vol.Schema(cv.matches_regex('.*uiae.*'))
    with pytest.raises(vol.Invalid):
        schema(1.0)
    with pytest.raises(vol.Invalid):
        schema('  nrtd   ')
    test_str = 'This is a test including uiae.'
    assert (schema(test_str) == test_str)