def test(self): """ Test various inputs and see that they are correct. """ self.assertEqual(misc._alignData(100, 100), (4, 25, 25)) self.assertEqual(misc._alignData(512, 512), (512, 1, 1)) self.assertEqual(misc._alignData(1, 1024), (1, 1, 1024)) self.assertEqual(misc._alignData(10240, 512), (512, 20, 1)) self.assertEqual(misc._alignData(1, 1), (1, 1, 1))
def test_align_data(length, offset, expected): alignment = misc._alignData(length, offset) assert alignment == expected for value in alignment: assert isinstance(value, int)