diff options
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() |