Skip to content

Commit b3150b1

Browse files
author
Matt Land
committed
add test for byte order
1 parent 86ea43a commit b3150b1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

adafruit_imageload/tests/test_bmp_indexed_load.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class TestBmpIndexedLoad(TestCase):
8-
def test_load_works_p1_ascii(self):
8+
def test_order_bgra_to_rgba(self):
99
test_file = os.path.join(
1010
os.path.dirname(__file__), "..", "..", "examples", "images", "4bit.bmp"
1111
)
@@ -26,5 +26,7 @@ def test_load_works_p1_ascii(self):
2626

2727
self.assertEqual(16, palette.num_colors)
2828
palette.validate()
29+
# make sure bye order swapped
30+
self.assertTrue(palette[4] in [b'\x9d\x00\xff\x00', b'\x9d\x00\xff'])
2931
# uncomment line below to see a string representation of the object
30-
# self.fail(str(palette))
32+
#self.fail(str(palette))

0 commit comments

Comments
 (0)