def test_big_landsat_search(self): """ Search for a bunch of Landsat data """ search = Query(date='2017-01-01', satellite_name='Landsat-8') self.assertEqual(search.found(), 564) scenes = search.scenes() self.assertEqual(len(scenes), 564) # verify this is 564 unique scenes ids = set([s.scene_id for s in scenes]) self.assertEqual(len(ids), 564)
def test_big_sentinel_search(self): """ Search for a bunch of Sentinel data """ search = Query(**{ 'datetime': '2017-01-01', 'eo:platform': 'sentinel-2a' }) self.assertEqual(search.found(), self.num_sentinel) scenes = search.items() self.assertEqual(len(scenes), self.num_sentinel)
def test_big_landsat_search(self): """ Search for a bunch of Landsat data """ search = Query(**{ 'datetime': '2017-01-01', 'eo:platform': 'landsat-8' }) self.assertEqual(search.found(), self.num_landsat) scenes = search.items() self.assertEqual(len(scenes), self.num_landsat)
def test_big_sentinel_search(self): """ Search for a bunch of Sentinel data """ search = Query(date='2017-01-01', satellite_name='Sentinel-2A') self.assertEqual(search.found(), self.num_sentinel) scenes = search.scenes() self.assertEqual(len(scenes), self.num_sentinel)
def test_big_landsat_search(self): """ Search for a bunch of Landsat data """ search = Query(date='2017-01-01', satellite_name='Landsat-8') self.assertEqual(search.found(), self.num_landsat) scenes = search.scenes() self.assertEqual(len(scenes), self.num_landsat)
def test_bad_search(self): """ Run a bad query """ q = Query(limit='a') with self.assertRaises(SatSearchError): q.found()
def test_empty_search(self): """ Perform search for 0 results """ search = Query(scene_id='nosuchscene') self.assertEqual(search.found(), 0)
def test_hits(self): """ Check total number of results """ search = Query(date='2017-01-01') hits = search.found() self.assertEqual(hits, 4267)
def get_queries(self): """ Initialize and return search object """ return { s: Query(scene_id=self.results[s]['results'][0]['scene_id']) for s in self.results }
def test_bad_search(self): """ Run a bad query """ q = Query(limit='a') q.found()
def get_queries(self): """ Initialize and return search object """ return { s: Query(id=self.results[s]['features'][0]['properties']['id']) for s in self.results }