示例#1
0
def test_recognize_url_https():
    href = 'https://jenyay.net'
    basepath = ''
    recognizer = ur.URLRecognizer('')

    result = recognizer.recognize(href)
    assert result == href
示例#2
0
def test_recognize_url_none():
    href = None
    recognizer = ur.URLRecognizer('')

    result = recognizer.recognize(href)
    assert result is None
示例#3
0
def test_recognize_url_invalid():
    href = 'page://jenyay.net'
    recognizer = ur.URLRecognizer('')

    result = recognizer.recognize(href)
    assert result is None
示例#4
0
def test_recognize_url_ftp():
    href = 'ftp://jenyay.net'
    recognizer = ur.URLRecognizer('')

    result = recognizer.recognize(href)
    assert result == href
示例#5
0
def test_recognize_url_mailto():
    href = 'mailto:[email protected]'
    recognizer = ur.URLRecognizer('')

    result = recognizer.recognize(href)
    assert result == href