[albatross-users] Documentation test case fails on amd64

Fabian Fagerholm fabbe at paniq.net
Wed Oct 11 01:40:44 EST 2006


Hi!

I got a Debian bug report about the albatross build failing on amd64.
The build fails on a documentation test because the Python built-in
hash() function doesn't return the same value on all platforms:

Testing "doctest/tags-value1" failed, Line 6: output does not match
example
Expected:
hash('spam') is 1626740519

Got:
hash('spam') is -1840390907728881881

I changed doc/doctest/tags-value1 to the following:

--8<--
>>> import albatross, md5
>>> ctx = albatross.SimpleContext('.')
>>> m = md5.new()
>>> m.update('spam')
>>> albatross.Template(ctx, '<magic>', '''
... int(m.hexdigest(), 16) is <al-value expr="int(m.hexdigest(), 16)" whitespace>
... ''').to_html(ctx)
>>> ctx.flush_content()
int(m.hexdigest(), 16) is 298574805507236127170346637616339707884L
--8<--

This should be portable (tested on i686 and amd64). You might want to
change the test for the next upstream version of albatross.

Cheers,
-- 
Fabian Fagerholm <fabbe at paniq.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20061010/b2c1b4a2/attachment.pgp>


More information about the Albatross-users mailing list