Skip to content

Commit dad49c7

Browse files
committed
add tests for updated apply function
1 parent b813635 commit dad49c7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/extensions/test_view.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,29 @@ def test_apply(self):
2929
sun_azimuth=2.0,
3030
sun_elevation=1.0)
3131

32+
def test_apply_one(self):
33+
item = next(TestCases.test_case_2().get_all_items())
34+
with self.assertRaises(ExtensionError):
35+
item.ext.view
36+
37+
item.ext.enable(Extensions.VIEW)
38+
item.ext.view.apply(off_nadir=1.0)
39+
40+
@unittest.expectedFailure
41+
def test_apply_none(self):
42+
item = next(TestCases.test_case_2().get_all_items())
43+
with self.assertRaises(ExtensionError):
44+
item.ext.view
45+
46+
item.ext.enable(Extensions.VIEW)
47+
item.ext.view.apply(
48+
off_nadir=None,
49+
incidence_angle=None,
50+
azimuth=None,
51+
sun_azimuth=None,
52+
sun_elevation=None,
53+
)
54+
3255
def test_validate_view(self):
3356
item = pystac.read_file(self.example_uri)
3457
item.validate()

0 commit comments

Comments
 (0)