예제 #1
0
def test_url_validate_fail():
    f = URL()
    for value in ('not_a_url', 'otherthing'):
        with pytest.raises(FieldSet.Error):
            f._validate_pattern(f.regex, value)
예제 #2
0
def test_url_validate_pattern_use_first_found():
    f = URL(use_first_found=True)
    for value in ('http://google.com/ncr', 'https://www.rebelmouse.com'):
        assert f._validate_pattern(f.regex, value) == value
예제 #3
0
def test_url_validate_pattern():
    f = URL()
    for value in ('http://google.com/ncr', 'https://www.rebelmouse.com'):
        assert f._validate_pattern(f.regex, value)[0] == value
예제 #4
0
def test_url_validate_fail():
    f = URL()
    for value in ('not_a_url', 'otherthing'):
        with pytest.raises(FieldSet.Error):
            f._validate_pattern(f.regex, value)
예제 #5
0
def test_url_validate_pattern_use_first_found():
    f = URL(use_first_found=True)
    for value in ('http://google.com/ncr', 'https://www.rebelmouse.com'):
        assert f._validate_pattern(f.regex, value) == value
예제 #6
0
def test_url_validate_pattern():
    f = URL()
    for value in ('http://google.com/ncr', 'https://www.rebelmouse.com'):
        assert f._validate_pattern(f.regex, value)[0] == value