コード例 #1
0
 def test_not_json(self):
     """
     fdw.GeoJSON.execute receive non-JSON response
     """
     options = {'url': 'http://raw.githubusercontent.com'}
     columns = ['geom']
     fdw = GeoJSON(options, columns)
     rows = fdw.execute([], columns)
     self.assertListEqual(rows, [])
コード例 #2
0
ファイル: geojson.py プロジェクト: Vadim0908/geofdw
 def test_not_json(self):
   """
   fdw.GeoJSON.execute receive non-JSON response
   """
   options = {'url' : 'http://raw.githubusercontent.com'}
   columns = ['geom']
   fdw = GeoJSON(options, columns)
   rows = fdw.execute([], columns)
   self.assertListEqual(rows, [])
コード例 #3
0
 def test_execute_bad_url(self):
     """
     fdw.GeoJSON.execute non-existant URL
     """
     options = {'url': 'http://d.xyz'}
     columns = ['geom']
     fdw = GeoJSON(options, columns)
     rows = fdw.execute([], columns)
     self.assertListEqual(rows, [])
コード例 #4
0
ファイル: geojson.py プロジェクト: Vadim0908/geofdw
 def test_execute_bad_url(self):
   """
   fdw.GeoJSON.execute non-existant URL
   """
   options = {'url' : 'http://d.xyz'}
   columns = ['geom']
   fdw = GeoJSON(options, columns)
   rows = fdw.execute([], columns)
   self.assertListEqual(rows, [])
コード例 #5
0
ファイル: geojson.py プロジェクト: Vadim0908/geofdw
 def test_not_geojson(self):
   """
   fdw.GeoJSON.execute receive non-GeoJSON response
   """
   options = {'url' : 'https://raw.githubusercontent.com/fge/sample-json-schemas/master/json-home/json-home.json'}
   columns = ['geom']
   fdw = GeoJSON(options, columns)
   rows = fdw.execute([], columns)
   self.assertListEqual(rows, [])
コード例 #6
0
ファイル: geojson.py プロジェクト: Vadim0908/geofdw
 def test_geojson_attribute(self):
   """
   fdw.GeoJSON.execute receive GeoJSON response with non-spatial attribute
   """
   options = {'url' : self.EXAMPLE}
   columns = ['geom', 'NAME']
   fdw = GeoJSON(options, columns)
   rows = fdw.execute([], ['NAME'])
   for row in rows:
     self.assertIn(row['NAME'], ['Alex', 'Bonnie', 'Charley', 'Danielle', 'Earl', 'Frances', 'Gaston', 'Hermine', 'Ivan', 'Tropical Depression 2', 'Tropical Depression 10', 'Jeanne', 'Karl', 'Lisa', 'Matthew', 'Nicole', 'Otto'])
コード例 #7
0
ファイル: geojson.py プロジェクト: Vadim0908/geofdw
 def test_geojson(self):
   """
   fdw.GeoJSON.execute receive GeoJSON response
   """
   options = {'url' : self.EXAMPLE}
   columns = ['geom']
   fdw = GeoJSON(options, columns)
   rows = fdw.execute([], columns)
   for row in rows:
     self.assertIsInstance(row['geom'], str)
コード例 #8
0
 def test_geojson(self):
     """
     fdw.GeoJSON.execute receive GeoJSON response
     """
     options = {'url': self.EXAMPLE}
     columns = ['geom']
     fdw = GeoJSON(options, columns)
     rows = fdw.execute([], columns)
     for row in rows:
         wkb = row["geom"]
         geom = Geometry(wkb)
         self.assertIsInstance(geom, Point)
コード例 #9
0
 def test_not_geojson(self):
     """
     fdw.GeoJSON.execute receive non-GeoJSON response
     """
     options = {
         'url':
         'https://raw.githubusercontent.com/fge/sample-json-schemas/master/json-home/json-home.json'
     }
     columns = ['geom']
     fdw = GeoJSON(options, columns)
     rows = fdw.execute([], columns)
     self.assertListEqual(rows, [])
コード例 #10
0
 def test_geojson_attribute(self):
     """
     fdw.GeoJSON.execute receive GeoJSON response with non-spatial attribute
     """
     options = {'url': self.EXAMPLE}
     columns = ['geom', 'NAME']
     fdw = GeoJSON(options, columns)
     rows = fdw.execute([], ['NAME'])
     for row in rows:
         self.assertIn(row['NAME'], [
             'Alex', 'Bonnie', 'Charley', 'Danielle', 'Earl', 'Frances',
             'Gaston', 'Hermine', 'Ivan', 'Tropical Depression 2',
             'Tropical Depression 10', 'Jeanne', 'Karl', 'Lisa', 'Matthew',
             'Nicole', 'Otto'
         ])