diff options
author | Joel Nothman <joel.nothman@gmail.com> | 2012-09-22 22:58:46 +1000 |
---|---|---|
committer | Joel Nothman <joel.nothman@gmail.com> | 2012-09-22 22:58:46 +1000 |
commit | 032df6f2d940ee443e7d5ac7e484e4716b124a4e (patch) | |
tree | 5bf329af15c605747e5775b0b16805d72cb8cccb /test/test_pack.py | |
parent | 28058fb53d21097947d190bcc47e3609a6794e7a (diff) | |
parent | 5b66edaa156c43793b6f68013a738f545885b8d6 (diff) | |
download | msgpack-python-032df6f2d940ee443e7d5ac7e484e4716b124a4e.tar.gz |
Merge remote-tracking branch 'origin/master' into skip
Diffstat (limited to 'test/test_pack.py')
-rw-r--r-- | test/test_pack.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_pack.py b/test/test_pack.py index 898cdb9..85d11a0 100644 --- a/test/test_pack.py +++ b/test/test_pack.py @@ -2,6 +2,7 @@ # coding: utf-8 import six +import struct from nose import main from nose.tools import * from nose.plugins.skip import SkipTest @@ -86,5 +87,9 @@ def testDecodeBinary(): re = unpackb(packb("abc"), encoding=None) assert_equal(re, b"abc") +def testPackFloat(): + assert_equal(packb(1.0, use_single_float=True), b'\xca' + struct.pack('>f', 1.0)) + assert_equal(packb(1.0, use_single_float=False), b'\xcb' + struct.pack('>d', 1.0)) + if __name__ == '__main__': main() |