def test_parse_rgb(self): frame_list = parse_file(io.StringIO(_RGB_RAW), 4, 4, 3) self.assertTrue(np.array_equal(_RGB_FLAT, frame_list))
def test_parse_grayscale(self): frame_list = parse_file(io.StringIO(_GRAYSCALE_RAW), 4, 4, 1) self.assertTrue(np.array_equal(_GRAYSCALE_FLAT, frame_list))
def test_multiple_grayscale(self): frame_list = parse_file(io.StringIO(_GRAYSCALE_RAW_MULTI), 4, 4, 1) self.assertTrue(np.array_equal(_GRAYSCALE_FLAT_MULTI, frame_list)) reshaped = reshape_bitmaps(frame_list, 4, 4, 1) self.assertTrue(np.array_equal(_GRAYSCALE_RESHAPED_MULTI, reshaped))