示例#1
0
def test_conversion_with_no_name():
    testDir = os.path.dirname(os.path.realpath(__file__))
    imagePath = os.path.join(testDir, 'test_files', 'rgb_geotiff.tiff')
    tmpdir = tempfile.mkdtemp()
    outputPath = tasks.create_tiff(imagePath, outputDir=tmpdir)
    assert os.path.getsize(outputPath) > 2000
    shutil.rmtree(tmpdir)
示例#2
0
def test_conversion_with_non_tiff_name():
    testDir = os.path.dirname(os.path.realpath(__file__))
    imagePath = os.path.join(testDir, 'test_files', 'yb10kx5k.png')
    tmpdir = tempfile.mkdtemp()
    outputPath = tasks.create_tiff(imagePath, 'temp.test', tmpdir)
    assert os.path.getsize(outputPath) > 500000
    shutil.rmtree(tmpdir)
示例#3
0
def test_conversion_failure():
    with pytest.raises(Exception):
        tasks.create_tiff(os.path.realpath(__file__))
示例#4
0
def test_conversion_missing_file():
    with pytest.raises(Exception):
        tasks.create_tiff('nosuchfile')
示例#5
0
def test_conversion_with_no_directory():
    testDir = os.path.dirname(os.path.realpath(__file__))
    imagePath = os.path.join(testDir, 'test_files', 'yb10kx5k.png')
    outputPath = tasks.create_tiff(imagePath, 'temp.tiff')
    assert os.path.getsize(outputPath) > 500000
    os.unlink(outputPath)