Skip to content

Commit

Permalink
using zipped geodatabases for ogr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexArcPy committed Oct 12, 2018
1 parent 84894cc commit f700696
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import struct
import tempfile
import pkgutil
import tempfile
import zipfile

# adding the project folder to support running test files individually and
# from the IDE
Expand All @@ -15,6 +17,11 @@
except BaseException:
import registrant # noqa: F401

temp_dir = tempfile.gettempdir()
for gdb_zip in [r'data\Adv_ogr_gdb.zip', r'data\Basic_ogr_gdb.zip']:
zip_ref = zipfile.ZipFile(gdb_zip, 'r')
zip_ref.extractall(temp_dir)
zip_ref.close()

NO_OGR_ENV_MESSAGE = """
Running tests with Python installation with no ogr available"""
Expand All @@ -35,12 +42,12 @@
'Basic_ogr': {
'name': 'Basic_ogr',
'json_results': r'data\Basic_ogr.json',
'ogr_geodatabase': r'data\Basic_ogr.gdb',
'ogr_geodatabase': os.path.join(temp_dir, 'Basic_ogr.gdb'),
},
'Advanced_ogr': {
'name': 'Adv_ogr',
'json_results': r'data\Adv_ogr.json',
'ogr_geodatabase': r'data\Adv_ogr.gdb',
'ogr_geodatabase': os.path.join(temp_dir, 'Adv_ogr.gdb'),
},
'Complete': {
'name': 'Complete',
Expand Down
Binary file added tests/data/Adv_ogr_gdb.zip
Binary file not shown.
Binary file added tests/data/Basic_ogr_gdb.zip
Binary file not shown.

0 comments on commit f700696

Please sign in to comment.