Beispiel #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)
Beispiel #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
Beispiel #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
Beispiel #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)
Beispiel #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
Beispiel #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