Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test fails in tests/test_expander_time.py #51

Open
keszybz opened this issue Jan 30, 2015 · 0 comments
Open

test fails in tests/test_expander_time.py #51

keszybz opened this issue Jan 30, 2015 · 0 comments

Comments

@keszybz
Copy link

keszybz commented Jan 30, 2015

$ py.test tests/
...
============================================ FAILURES =============================================
_________________________________________ test_codes[43] __________________________________________

s = 'xrU', expected = 'XVI', date = '1970-1-1 + 16 second'

    def e(s, expected, date="09 Feb 2008 10:55:17"):
>       expandstr(u'{{#time:%s|%s}}' % (s, date), expected)

tests/test_expander_time.py:8: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

s = '{{#time:xrU|1970-1-1 + 16 second}}', expected = 'XVI', wikidb = None, pagename = 'thispage'

    def expandstr(s, expected=None, wikidb=None, pagename='thispage'):
        """debug function. expand templates in string s"""
        if wikidb:
            db = wikidb
        else:
            db = DictDB(dict(a=s))

        te = evaluate.Expander(s, pagename=pagename, wikidb=db)
        res = te.expandTemplates()
        print "EXPAND: %r -> %r" % (s, res)
        if expected is not None:
>           assert res==expected, "expected %r, got %r" % (expected, res)
E           AssertionError: expected 'XVI', got u'<strong class="error">Error: invalid time</strong>'

/usr/lib64/python2.7/site-packages/mwlib/templ/misc.py:49: AssertionError
-------------------------------------- Captured stdout call ---------------------------------------
EXPAND: u'{{#time:xrU|1970-1-1 + 16 second}}' -> u'<strong class="error">Error: invalid time</strong>'
_____________________________________ test_time_minus_days[0] _____________________________________

s = '{{#time:Y-m-d| 20070827000000 -12 day}}', expected = '2007-08-15', wikidb = None
pagename = 'thispage'

    def expandstr(s, expected=None, wikidb=None, pagename='thispage'):
        """debug function. expand templates in string s"""
        if wikidb:
            db = wikidb
        else:
            db = DictDB(dict(a=s))

        te = evaluate.Expander(s, pagename=pagename, wikidb=db)
        res = te.expandTemplates()
        print "EXPAND: %r -> %r" % (s, res)
        if expected is not None:
>           assert res==expected, "expected %r, got %r" % (expected, res)
E           AssertionError: expected '2007-08-15', got u'<strong class="error">Error: invalid time</strong>'

/usr/lib64/python2.7/site-packages/mwlib/templ/misc.py:49: AssertionError
-------------------------------------- Captured stdout call ---------------------------------------
EXPAND: '{{#time:Y-m-d| 20070827000000 -12 day}}' -> u'<strong class="error">Error: invalid time</strong>'

This is with today's git (c41330f), but those two tests fail also with mwlib 0.15.11 and 0.15.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant