diff --git a/harmony_browse_image_generator/adapter.py b/harmony_browse_image_generator/adapter.py index d4a0ae4..3f59d56 100644 --- a/harmony_browse_image_generator/adapter.py +++ b/harmony_browse_image_generator/adapter.py @@ -65,7 +65,7 @@ def validate_message(self): 'Harmony ScaleExtents must be in order [xmin,ymin,xmax,ymax].' ) - def asset_from_item(self, item: Item) -> Asset: + def get_asset_from_item(self, item: Item) -> Asset: """Returns the correct browse asset from a stac Item. This is used to select which asset is used by HyBIG to generate @@ -97,7 +97,7 @@ def process_item(self, item: Item, source: HarmonySource) -> Item: results = item.clone() results.assets = {} - asset = self.asset_from_item(item) + asset = self.get_asset_from_item(item) color_palette = get_color_palette_from_item(item) diff --git a/tests/unit/test_adapter.py b/tests/unit/test_adapter.py index fccd6f3..1376cd5 100644 --- a/tests/unit/test_adapter.py +++ b/tests/unit/test_adapter.py @@ -158,7 +158,7 @@ def test_create_output_stac_items(self): class TestAdapterAssetFromItem(TestCase): - """A class testing asset_from_item class.""" + """A class testing get_asset_from_item class.""" def setUp(self): self.adapter = BrowseImageGeneratorAdapter({}, {}) @@ -172,14 +172,14 @@ def item_fixture(self, assets: dict) -> Item: item.assets = assets return item - def test_asset_from_item_with_visual_role(self): + def test_get_asset_from_item_with_visual_role(self): with self.subTest('data asset first'): item = self.item_fixture( {'data': self.data_asset, 'visual': self.visual_asset} ) expected = self.visual_asset - actual = self.adapter.asset_from_item(item) + actual = self.adapter.get_asset_from_item(item) self.assertEqual(expected, actual) @@ -189,26 +189,26 @@ def test_asset_from_item_with_visual_role(self): ) expected = self.visual_asset - actual = self.adapter.asset_from_item(item) + actual = self.adapter.get_asset_from_item(item) self.assertEqual(expected, actual) - def test_asset_from_item_with_data_role(self): + def test_get_asset_from_item_with_data_role(self): item = self.item_fixture({'data': self.data_asset, 'other': self.other_asset}) expected = self.data_asset - actual = self.adapter.asset_from_item(item) + actual = self.adapter.get_asset_from_item(item) self.assertEqual(expected, actual) - def test_asset_from_item_no_roles(self): + def test_get_asset_from_item_no_roles(self): item = self.item_fixture({'none': self.none_asset}) with self.assertRaises(StopIteration): - self.adapter.asset_from_item(item) + self.adapter.get_asset_from_item(item) - def test_asset_from_item_no_matching_roles(self): + def test_get_asset_from_item_no_matching_roles(self): item = self.item_fixture( {'first': self.other_asset, 'second': self.other_asset} ) with self.assertRaises(StopIteration): - self.adapter.asset_from_item(item) + self.adapter.get_asset_from_item(item)