From a812f6c48035f3d09484bd0dfed1710e3aa8cc22 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 23 Aug 2017 23:09:09 +0300 Subject: [PATCH] fix tests test_I16 --- Tests/test_lib_pack.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Tests/test_lib_pack.py b/Tests/test_lib_pack.py index 4a7e1f844..432754088 100644 --- a/Tests/test_lib_pack.py +++ b/Tests/test_lib_pack.py @@ -344,10 +344,15 @@ class TestLibUnpack(PillowTestCase): self.assert_unpack("I;16", "I;16", 2, 0x0201, 0x0403, 0x0605) self.assert_unpack("I;16B", "I;16B", 2, 0x0102, 0x0304, 0x0506) self.assert_unpack("I;16L", "I;16L", 2, 0x0201, 0x0403, 0x0605) - self.assert_unpack("I;16", "I;16N", 2, 0x0201, 0x0403, 0x0605) - self.assert_unpack("I;16B", "I;16N", 2, 0x0201, 0x0403, 0x0605) - self.assert_unpack("I;16L", "I;16N", 2, 0x0201, 0x0403, 0x0605) self.assert_unpack("I;16", "I;12", 2, 0x0010, 0x0203, 0x0040, 0x0506) + if sys.byteorder == 'little': + self.assert_unpack("I;16", "I;16N", 2, 0x0201, 0x0403, 0x0605) + self.assert_unpack("I;16B", "I;16N", 2, 0x0201, 0x0403, 0x0605) + self.assert_unpack("I;16L", "I;16N", 2, 0x0201, 0x0403, 0x0605) + else: + self.assert_unpack("I;16", "I;16N", 2, 0x0102, 0x0304, 0x0506) + self.assert_unpack("I;16B", "I;16N", 2, 0x0102, 0x0304, 0x0506) + self.assert_unpack("I;16L", "I;16N", 2, 0x0102, 0x0304, 0x0506) def test_value_error(self): self.assertRaises(ValueError, self.assert_unpack, "L", "L", 0, 0)