mirror of
https://github.com/rasterio/rasterio.git
synced 2025-12-08 17:36:12 +00:00
27 lines
634 B
Python
27 lines
634 B
Python
import logging
|
|
import os.path
|
|
import unittest
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
import tempfile
|
|
|
|
import numpy
|
|
|
|
import rasterio
|
|
|
|
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
|
|
|
class CopyTest(unittest.TestCase):
|
|
def setUp(self):
|
|
self.tempdir = tempfile.mkdtemp()
|
|
def tearDown(self):
|
|
shutil.rmtree(self.tempdir)
|
|
def test_copy(self):
|
|
name = os.path.join(self.tempdir, 'test_copy.tif')
|
|
rasterio.copy(
|
|
'tests/data/RGB.byte.tif',
|
|
name)
|
|
info = subprocess.check_output(["gdalinfo", name])
|
|
self.assert_("GTiff" in info.decode('utf-8'))
|