Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/extensions/test_eo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pystac.collection import RangeSummary
from pystac.utils import get_opt
from pystac.extensions.eo import EOExtension, Band
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict


class BandsTest(unittest.TestCase):
Expand Down Expand Up @@ -49,7 +49,7 @@ def setUp(self) -> None:
def test_to_from_dict(self) -> None:
with open(self.LANDSAT_EXAMPLE_URI) as f:
item_dict = json.load(f)
test_to_from_dict(self, Item, item_dict)
assert_to_from_dict(self, Item, item_dict)

def test_validate_eo(self) -> None:
item = pystac.read_file(self.LANDSAT_EXAMPLE_URI)
Expand Down
4 changes: 2 additions & 2 deletions tests/extensions/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest

import pystac
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict
from pystac.extensions.file import FileExtension, FileDataType


Expand All @@ -15,7 +15,7 @@ def setUp(self) -> None:
def test_to_from_dict(self) -> None:
with open(self.FILE_EXAMPLE_URI) as f:
item_dict = json.load(f)
test_to_from_dict(self, pystac.Item, item_dict)
assert_to_from_dict(self, pystac.Item, item_dict)

def test_validate_file(self) -> None:
item = pystac.Item.from_file(self.FILE_EXAMPLE_URI)
Expand Down
4 changes: 2 additions & 2 deletions tests/extensions/test_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
import pystac.validation
from pystac.utils import get_opt
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict


class LabelTest(unittest.TestCase):
Expand All @@ -36,7 +36,7 @@ def test_to_from_dict(self) -> None:
with open(self.label_example_1_uri) as f:
label_example_1_dict = json.load(f)

test_to_from_dict(self, Item, label_example_1_dict)
assert_to_from_dict(self, Item, label_example_1_dict)

def test_from_file(self) -> None:
label_example_1 = Item.from_file(self.label_example_1_uri)
Expand Down
4 changes: 2 additions & 2 deletions tests/extensions/test_pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
PointcloudSchema,
PointcloudStatistic,
)
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict


class PointcloudTest(unittest.TestCase):
Expand All @@ -27,7 +27,7 @@ def setUp(self) -> None:
def test_to_from_dict(self) -> None:
with open(self.example_uri) as f:
d = json.load(f)
test_to_from_dict(self, pystac.Item, d)
assert_to_from_dict(self, pystac.Item, d)

def test_apply(self) -> None:
item = next(iter(TestCases.test_case_2().get_all_items()))
Expand Down
4 changes: 2 additions & 2 deletions tests/extensions/test_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pystac
from pystac.extensions.projection import ProjectionExtension
from pystac.utils import get_opt
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict

WKT2 = """
GEOGCS["WGS 84",
Expand Down Expand Up @@ -80,7 +80,7 @@ def setUp(self) -> None:
def test_to_from_dict(self) -> None:
with open(self.example_uri) as f:
d = json.load(f)
test_to_from_dict(self, pystac.Item, d)
assert_to_from_dict(self, pystac.Item, d)

def test_apply(self) -> None:
item = next(iter(TestCases.test_case_2().get_all_items()))
Expand Down
4 changes: 2 additions & 2 deletions tests/extensions/test_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
DataType,
Statistics,
)
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict


class RasterTest(unittest.TestCase):
Expand All @@ -30,7 +30,7 @@ def setUp(self) -> None:
def test_to_from_dict(self) -> None:
with open(self.PLANET_EXAMPLE_URI) as f:
item_dict = json.load(f)
test_to_from_dict(self, Item, item_dict)
assert_to_from_dict(self, Item, item_dict)

def test_validate_raster(self) -> None:
item = pystac.read_file(self.PLANET_EXAMPLE_URI)
Expand Down
4 changes: 2 additions & 2 deletions tests/extensions/test_timestamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pystac
from pystac.extensions.timestamps import TimestampsExtension
from pystac.utils import get_opt, str_to_datetime, datetime_to_str
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict


class TimestampsTest(unittest.TestCase):
Expand All @@ -20,7 +20,7 @@ def setUp(self) -> None:
self.sample_datetime = str_to_datetime(self.sample_datetime_str)

def test_to_from_dict(self) -> None:
test_to_from_dict(self, pystac.Item, self.item_dict)
assert_to_from_dict(self, pystac.Item, self.item_dict)

def test_apply(self) -> None:
item = next(iter(TestCases.test_case_2().get_all_items()))
Expand Down
4 changes: 2 additions & 2 deletions tests/extensions/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pystac
from pystac.extensions.view import ViewExtension
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict


class ViewTest(unittest.TestCase):
Expand All @@ -14,7 +14,7 @@ def setUp(self) -> None:
def test_to_from_dict(self) -> None:
with open(self.example_uri) as f:
d = json.load(f)
test_to_from_dict(self, pystac.Item, d)
assert_to_from_dict(self, pystac.Item, d)

def test_apply(self) -> None:
item = next(iter(TestCases.test_case_2().get_all_items()))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pystac.serialization.common_properties
from pystac.item import CommonMetadata
from pystac.utils import datetime_to_str, get_opt, str_to_datetime, is_absolute_href
from tests.utils import TestCases, test_to_from_dict
from tests.utils import TestCases, assert_to_from_dict


class ItemTest(unittest.TestCase):
Expand All @@ -26,7 +26,7 @@ def test_to_from_dict(self) -> None:

item_dict = self.get_example_item_dict()

test_to_from_dict(self, Item, item_dict)
assert_to_from_dict(self, Item, item_dict)
item = Item.from_dict(item_dict)
self.assertEqual(item.id, "CS3-20160503_132131_05")

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from tests.utils.stac_io_mock import MockStacIO # type:ignore


def test_to_from_dict(
def assert_to_from_dict(
test_class: unittest.TestCase,
stac_object_class: Type[pystac.STACObject],
d: Dict[str, Any],
Expand Down