def test_multiple_file_content(self): from pyresample import parse_area_file from pyresample.area_config import load_area_from_string area_list = [ """ease_sh: description: Antarctic EASE grid projection: a: 6371228.0 units: m lon_0: 0 proj: laea lat_0: -90 shape: height: 425 width: 425 area_extent: lower_left_xy: [-5326849.0625, -5326849.0625] upper_right_xy: [5326849.0625, 5326849.0625] units: m """, """ease_sh2: description: Antarctic EASE grid projection: a: 6371228.0 units: m lon_0: 0 proj: laea lat_0: -90 shape: height: 425 width: 425 area_extent: lower_left_xy: [-5326849.0625, -5326849.0625] upper_right_xy: [5326849.0625, 5326849.0625] units: m """ ] with self.assertWarns(DeprecationWarning): results = parse_area_file(area_list) self.assertEqual(len(results), 2) self.assertIn(results[0].area_id, ('ease_sh', 'ease_sh2')) self.assertIn(results[1].area_id, ('ease_sh', 'ease_sh2')) results2 = parse_area_file([io.StringIO(ar) for ar in area_list]) results3 = load_area_from_string(area_list) self.assertEqual(results, results2) self.assertEqual(results, results3)
def europe(): """Return european AreaDefinition.""" from pyresample.area_config import load_area_from_string return load_area_from_string(yaml_europe)