15
15
LayoutTemplate ,
16
16
TemplateLayoutStrategy ,
17
17
)
18
- from tests .utils import ARBITRARY_BBOX , ARBITRARY_GEOM , TestCases
18
+ from tests .utils import (
19
+ ARBITRARY_BBOX ,
20
+ ARBITRARY_GEOM ,
21
+ TestCases ,
22
+ path_includes_drive_letter ,
23
+ )
19
24
20
25
21
26
class LayoutTemplateTest (unittest .TestCase ):
@@ -412,6 +417,9 @@ def test_produces_layout_for_item(self) -> None:
412
417
class AsIsLayoutStrategyTest (unittest .TestCase ):
413
418
def setUp (self ) -> None :
414
419
self .strategy = AsIsLayoutStrategy ()
420
+ self .expected_local_href = (
421
+ "/an/href" if not path_includes_drive_letter () else "D:/an/href"
422
+ )
415
423
416
424
def test_catalog (self ) -> None :
417
425
cat = pystac .Catalog (id = "test" , description = "test desc" )
@@ -421,7 +429,7 @@ def test_catalog(self) -> None:
421
429
href = self .strategy .get_href (
422
430
cat , parent_dir = "https://example.com" , is_root = True
423
431
)
424
- self .assertEqual (href , "/an/href" )
432
+ self .assertEqual (href , self . expected_local_href )
425
433
426
434
def test_collection (self ) -> None :
427
435
collection = TestCases .case_8 ()
@@ -434,7 +442,7 @@ def test_collection(self) -> None:
434
442
href = self .strategy .get_href (
435
443
collection , parent_dir = "https://example.com" , is_root = True
436
444
)
437
- self .assertEqual (href , "/an/href" )
445
+ self .assertEqual (href , self . expected_local_href )
438
446
439
447
def test_item (self ) -> None :
440
448
collection = TestCases .case_8 ()
@@ -444,7 +452,7 @@ def test_item(self) -> None:
444
452
self .strategy .get_href (item , parent_dir = "http://example.com" )
445
453
item .set_self_href ("/an/href" )
446
454
href = self .strategy .get_href (item , parent_dir = "http://example.com" )
447
- self .assertEqual (href , "/an/href" )
455
+ self .assertEqual (href , self . expected_local_href )
448
456
449
457
450
458
class APILayoutStrategyTest (unittest .TestCase ):
0 commit comments