def test_cubefile_image_format(pattern_data): filename = os.path.join(DATA_DIR, 'pattern.cub') image = CubeFile(open(filename, 'rb'), memory_layout='IMAGE') assert image.data.shape == (90, 90) assert image.data.size == 8100 assert_almost_equal(image.data, pattern_data)
def test_stream_error(): with pytest.raises(TypeError): CubeFile('filename.cub')