File: test_getRefs.py

package info (click to toggle)
python-textile 1%3A4.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: python: 2,791; makefile: 17; sh: 7
file content (22 lines) | stat: -rw-r--r-- 513 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from textile import Textile


def test_getRefs():
    t = Textile()
    result = t.getRefs("some text [Google]http://www.google.com")
    expect = 'some text '
    assert result == expect

    result = t.urlrefs
    expect = {'Google': 'http://www.google.com'}
    assert result == expect

    t2 = Textile()

    result = t2.getRefs("my ftp [ftp]ftp://example.com")
    expect = 'my ftp '
    assert result == expect

    result = t2.urlrefs
    expect = {'ftp': 'ftp://example.com'}
    assert result == expect