File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -939,7 +939,7 @@ def test_collections_cache_correctly(self) -> None:
939
939
940
940
def test_reading_iterating_and_writing_works_as_expected (self ) -> None :
941
941
"""Test case to cover issue #88"""
942
- stac_uri = "tests/ data-files/catalogs/test-case-6/catalog.json"
942
+ stac_uri = TestCases . get_path ( " data-files/catalogs/test-case-6/catalog.json")
943
943
cat = Catalog .from_file (stac_uri )
944
944
945
945
# Iterate over the items. This was causing failure in
Original file line number Diff line number Diff line change 2
2
import json
3
3
from pystac .item_collection import ItemCollection
4
4
import unittest
5
+ from os .path import relpath
6
+
5
7
import pystac
6
8
7
9
from tests .utils import TestCases
@@ -101,7 +103,11 @@ def test_raise_error_for_invalid_object(self) -> None:
101
103
102
104
def test_from_relative_path (self ) -> None :
103
105
_ = pystac .ItemCollection .from_file (
104
- "./tests/data-files/item-collection/sample-item-collection.json"
106
+ relpath (
107
+ TestCases .get_path (
108
+ "data-files/item-collection/sample-item-collection.json"
109
+ )
110
+ )
105
111
)
106
112
107
113
def test_from_list_of_dicts (self ) -> None :
Original file line number Diff line number Diff line change 8
8
from pystac import utils
9
9
10
10
from pystac .utils import make_relative_href , make_absolute_href , is_absolute_href
11
+ from tests .utils import TestCases
11
12
12
13
13
14
class UtilsTest (unittest .TestCase ):
@@ -273,7 +274,9 @@ def test_datetime_to_str(self) -> None:
273
274
274
275
def test_geojson_bbox (self ) -> None :
275
276
# Use sample Geojson from https://en.wikipedia.org/wiki/GeoJSON
276
- with open ("tests/data-files/geojson/sample.geojson" ) as sample_geojson :
277
+ with open (
278
+ TestCases .get_path ("data-files/geojson/sample.geojson" )
279
+ ) as sample_geojson :
277
280
all_features = json .load (sample_geojson )
278
281
geom_dicts = [f ["geometry" ] for f in all_features ["features" ]]
279
282
for geom in geom_dicts :
You can’t perform that action at this time.
0 commit comments