diff options
| author | Yu-Jie Lin <livibetter@gmail.com> | 2013-08-16 20:22:43 +0800 |
|---|---|---|
| committer | Yu-Jie Lin <livibetter@gmail.com> | 2013-08-16 20:22:43 +0800 |
| commit | 205352b9081a92f2d85331e69282a15244a30fb5 (patch) | |
| tree | d8ae79310e40909bb71c2a33c875e037bef16b9b /tests | |
| parent | 15f8191c9f7a2dac88c5a6eb2b2886ee72387ff2 (diff) | |
| download | smartypants-git-205352b9081a92f2d85331e69282a15244a30fb5.tar.gz | |
deprecate str-type attr instead of direct removal, which will be removed at v2.0.0. Attr "-1" now is Attr.s (or "s")
a temporary function _str_attr_to_int is added for the transition before v2.0.0.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test.py b/tests/test.py index c03d647..e2a28c9 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,3 +1,7 @@ +#!/usr/bin/env python +# Copyright (c) 2013 Yu-Jie Lin +# Licensed under the BSD License, for detailed license information, see COPYING + import doctest import unittest @@ -6,7 +10,6 @@ from smartypants import Attr, smartyPants as sp class TestSmartypantsAllAttributes(unittest.TestCase): - # the default attribute is "1", which means "all". def test_dates(self): @@ -71,6 +74,18 @@ document.write('<a href="' + href + '">' + linktext + "</a>"); self.assertEqual(sp('"Isn\'t this fun?"'), '“Isn’t this fun?”') + def test_deprecated_str_attr(self): + + TEXT = '"foo" -- bar' + + T = sp(TEXT, 'q') + E = '“foo” -- bar' + self.assertEquals(T, E) + + T = sp(TEXT, 'qd') + E = '“foo” — bar' + self.assertEquals(T, E) + def load_tests(loader, tests, pattern): |
