예제 #1
0
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)
예제 #2
0
def test_stream_error():
    with pytest.raises(TypeError):
        CubeFile('filename.cub')