mirror of
https://github.com/drewcassidy/quicktex.git
synced 2024-09-13 06:37:34 +00:00
Add unit tests
This commit is contained in:
parent
289a4fa001
commit
5056e07f37
20
tests/test_rgbcx.py
Normal file
20
tests/test_rgbcx.py
Normal file
@ -0,0 +1,20 @@
|
||||
import unittest
|
||||
import python_rgbcx
|
||||
|
||||
|
||||
class MyTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.bc1_encoder = python_rgbcx.BC1Encoder()
|
||||
self.image = b'\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\x55\x55\x55\xFF\xAA\xAA\xAA\xFF' \
|
||||
b'\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\x55\x55\x55\xFF\xAA\xAA\xAA\xFF' \
|
||||
b'\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\x55\x55\x55\xFF\xAA\xAA\xAA\xFF' \
|
||||
b'\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\x55\x55\x55\xFF\xAA\xAA\xAA\xFF'
|
||||
|
||||
def test_block_size(self):
|
||||
out = self.bc1_encoder.encode_image(self.image, 4, 4)
|
||||
self.assertEqual(self.bc1_encoder.block_size, 8, 'incorrect reported block size')
|
||||
self.assertEqual(len(out), 8, 'incorrect returned block size')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in New Issue
Block a user