File: template_test.py

package info (click to toggle)
pybtex 0.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,628 kB
  • sloc: python: 13,585; makefile: 181; sh: 39; javascript: 29
file content (20 lines) | stat: -rw-r--r-- 638 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pytest
from pybtex.style.template import href, words


def test_old_href_syntax():
    with pytest.warns(
        DeprecationWarning,
        match=r'href \[url, text\] is deprecated since 0\.24'
    ):
        result = href ['www.test.org', 'click here'].format().render_as('html')
    assert result == '<a href="www.test.org">click here</a>'

    with pytest.warns(
        DeprecationWarning,
        match=r'href \[url, text\] is deprecated since 0\.24'
    ):
        result = href [words ['www.test2.org'], words ['click', 'here!']].format().render_as('html')
    assert result == '<a href="www.test2.org">click here!</a>'