Skip to content
Permalink
Browse files

Add a raster table to the test postgis setup, use it from dbmanager test

  • Loading branch information
strk committed Jun 6, 2017
1 parent 3738798 commit 7af47c2afa722a2c5740127e77ff852aa8950521
@@ -46,8 +46,8 @@ class TestDBManagerPostgisPlugin(unittest.TestCase):

def test_rasterTable(self):

#testdb = os.environ.get('QGIS_PGTEST_DB') or 'qgis_test'
#os.environ['PGDATABASE'] = testdb
testdb = os.environ.get('QGIS_PGTEST_DB') or 'qgis_test'
os.environ['PGDATABASE'] = testdb

obj = QObject() # needs to be kept alive
database = PGDatabase(obj, QgsDataSourceUri())
@@ -6,6 +6,7 @@ SCRIPTS="
tests/testdata/provider/testdata_pg_vectorjoin.sql
tests/testdata/provider/testdata_pg_hstore.sql
tests/testdata/provider/testdata_pg_array.sql
tests/testdata/provider/testdata_pg_raster.sql
"

dropdb qgis_test 2> /dev/null || true
@@ -0,0 +1,15 @@
-- Table: qgis_test.raster1

CREATE TABLE qgis_test."Raster1"
(
pk serial NOT NULL,
name character varying(255),
"Rast" raster
);

INSERT INTO qgis_test."Raster1" (name, "Rast") SELECT
'simple one',
ST_AddBand(
ST_MakeEmptyRaster(16, 32, 7, -5, 0.2, -0.7, 0, 0, 0),
1, '8BUI', 0.0, NULL
);

0 comments on commit 7af47c2

Please sign in to comment.
You can’t perform that action at this time.