Changeset - 44875d59a6bc
[Not reviewed]
default
0 1 0
timeless@gmail.com - 10 years ago 2016-05-03 13:52:42
timeless@gmail.com
spelling: extractor
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/other/test_libs.py
Show inline comments
 
@@ -172,25 +172,25 @@ class TestLibs(BaseTestCase):
 
        (dict(hours=24 * 5), u'in 5 days'),
 
        (dict(months=1), u'in 1 month'),
 
        (dict(months=1, days=1), u'in 1 month and 1 day'),
 
        (dict(years=1, months=1), u'in 1 year and 1 month')
 
    ])
 
    def test_age_in_future(self, age_args, expected):
 
        from kallithea.lib.utils2 import age
 
        from dateutil import relativedelta
 
        n = datetime.datetime(year=2012, month=5, day=17)
 
        delt = lambda *args, **kwargs: relativedelta.relativedelta(*args, **kwargs)
 
        self.assertEqual(age(n + delt(**age_args), now=n), expected)
 

	
 
    def test_tag_exctrator(self):
 
    def test_tag_extractor(self):
 
        sample = (
 
            "hello pta[tag] gog [[]] [[] sda ero[or]d [me =>>< sa]"
 
            "[requires] [stale] [see<>=>] [see => http://example.com]"
 
            "[requires => url] [lang => python] [just a tag]"
 
            "[,d] [ => ULR ] [obsolete] [desc]]"
 
        )
 
        from kallithea.lib.helpers import urlify_text
 
        res = urlify_text(sample, stylize=True)
 
        self.assertIn('<div class="metatag" tag="tag">tag</div>', res)
 
        self.assertIn('<div class="metatag" tag="obsolete">obsolete</div>', res)
 
        self.assertIn('<div class="metatag" tag="stale">stale</div>', res)
 
        self.assertIn('<div class="metatag" tag="lang">python</div>', res)
0 comments (0 inline, 0 general)