コード例 #1
0
ファイル: test_fields.py プロジェクト: kkszysiu/restea
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
ファイル: test_fields.py プロジェクト: kkszysiu/restea
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
ファイル: test_fields.py プロジェクト: kkszysiu/restea
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