Skip to content

Commit 8c9ecb4

Browse files
committed
Add migration test
1 parent a980842 commit 8c9ecb4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/extensions/test_eo.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pystac.summaries import RangeSummary
77
from pystac.utils import get_opt
88
from pystac.extensions.eo import EOExtension, Band
9+
from pystac.extensions.projection import ProjectionExtension
910
from tests.utils import TestCases, assert_to_from_dict
1011

1112

@@ -325,3 +326,23 @@ def test_should_raise_exception_when_passing_invalid_extension_object(
325326
EOExtension.ext,
326327
object(),
327328
)
329+
330+
331+
class EOMigrationTest(unittest.TestCase):
332+
def setUp(self) -> None:
333+
self.maxDiff = None
334+
self.item_0_8_path = TestCases.get_path(
335+
"data-files/examples/0.8.1/item-spec/examples/sentinel2-sample.json"
336+
)
337+
338+
def test_migration(self) -> None:
339+
with open(self.item_0_8_path) as src:
340+
item_dict = json.load(src)
341+
342+
self.assertIn("eo:epsg", item_dict["properties"])
343+
344+
item = Item.from_file(self.item_0_8_path)
345+
346+
self.assertNotIn("eo:epsg", item.properties)
347+
self.assertIn("proj:epsg", item.properties)
348+
self.assertIn(ProjectionExtension.get_schema_uri(), item.stac_extensions)

0 commit comments

Comments
 (0)