Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (2, 'Another Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771853.633171779 6880129.128272728,771842.2964842085 \
6880117.197908178,771807.1308239839 6880150.79394592,771818.4675156211 \
6880162.7242448665,771853.633171779 6880129.128272728)))', " + srid + "))")
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (3, 'A last Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771807.1308239839 6880150.79394592,771842.2964842085 \
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)
6880117.197908178,771807.1308239839 6880150.79394592,771818.4675156211 \
6880162.7242448665,771853.633171779 6880129.128272728)))', " + srid + "))")
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (3, 'A last Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771807.1308239839 6880150.79394592,771842.2964842085 \
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (3, 'A last Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771807.1308239839 6880150.79394592,771842.2964842085 \
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)
GeomFromText('MULTIPOLYGON(((771853.633171779 6880129.128272728,771842.2964842085 \
6880117.197908178,771807.1308239839 6880150.79394592,771818.4675156211 \
6880162.7242448665,771853.633171779 6880129.128272728)))', " + srid + "))")
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (3, 'A last Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771807.1308239839 6880150.79394592,771842.2964842085 \
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)
6880162.7242448665,771853.633171779 6880129.128272728)))', " + srid + "))")
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (3, 'A last Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771807.1308239839 6880150.79394592,771842.2964842085 \
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)
6880162.7242448665,771825.9029201793 6880170.713342139)))', " + srid + "))")
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (2, 'Another Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771853.633171779 6880129.128272728,771842.2964842085 \
6880117.197908178,771807.1308239839 6880150.79394592,771818.4675156211 \
6880162.7242448665,771853.633171779 6880129.128272728)))', " + srid + "))")
cursor.execute("INSERT INTO " + testTableName + " (id, label, value, " + geometryField + ") VALUES (3, 'A last Geometry', 20, \
GeomFromText('MULTIPOLYGON(((771807.1308239839 6880150.79394592,771842.2964842085 \
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)
GeomFromText('MULTIPOLYGON(((771807.1308239839 6880150.79394592,771842.2964842085 \
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)
6880117.197908178,771831.1791767566 6880105.270296125,771795.7209431691 \
6880138.862761175,771807.1308239839 6880150.79394592)))', " + srid + "))")
cursor.execute("ALTER TABLE " + testTableName + " ADD CONSTRAINT test_pkey " + " PRIMARY KEY (id)")
db.commit()
os.environ['GRASS_VERBOSE'] = '0'
try:
runner = unittest.TextTestRunner()
suite = unittest.TestSuite()
suite.addTest(GrassPostGisImporterTests("testGetDbInfos"))
suite.addTest(GrassPostGisImporterTests("testCheckLayers"))
suite.addTest(GrassPostGisImporterTests("testNoResult"))
suite.addTest(GrassPostGisImporterTests("testCheckComment"))
suite.addTest(GrassPostGisImporterTests("testImportGrassLayer"))
suite.addTest(GrassPostGisImporterTests("testGetGeometryInfos"))
suite.addTest(GrassPostGisImporterTests("testAddingCategoryWithPgDriverIsNecessary"))
suite.addTest(GrassPostGisImporterTests("testGeometryDuplicationIsNecessary"))
runner.run(suite)
finally:
cleanUp()
sys.exit(0)