Ejemplo n.º 1
0
 def test_files_not_found(self):
     with self.assertRaises(Exception):
         cli.invoke(
             paths=["tests/fixtures/shp/does_not_exist"],
             dbname=self.tmp.name,
             table="does_not_exist",
             primary_key=None,
             write_mode=None,
             srid=4326,
             spatialite_extension=None,
         )
Ejemplo n.º 2
0
 def test_custom_table_name(self):
     cli.invoke(
         paths=["tests/fixtures/shp/points.shp"],
         dbname=self.tmp.name,
         table="custom",
         primary_key=None,
         write_mode=None,
         srid=4326,
         spatialite_extension=None,
     )
     records = self.conn.execute(
         "SELECT * FROM custom ORDER BY id;").fetchall()
     self.assertEqual(3, len(records))
Ejemplo n.º 3
0
 def test_multiple_files(self):
     cli.invoke(
         paths=["tests/fixtures/shp/"],
         dbname=self.tmp.name,
         table="irrelevant",
         primary_key=None,
         write_mode=None,
         srid=4326,
         spatialite_extension=None,
     )
     records = self.conn.execute(
         "SELECT * FROM [./points] ORDER BY id;").fetchall()
     self.assertEqual(3, len(records))
     records = self.conn.execute(
         "SELECT * FROM [./polygons] ORDER BY id;").fetchall()
     self.assertEqual(3, len(records))