Skip to content

Commit 53726f7

Browse files
committed
tests: Verify empty observation_direction property
1 parent f9573f8 commit 53726f7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/extensions/test_sar.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
"""Tests for pystac.extensions.sar."""
22

33
import datetime
4+
from random import choice
45
from typing import List
56
import unittest
67

8+
from string import ascii_letters
9+
710
import pystac
811
from pystac.extensions import sar
912
from pystac.extensions.sar import SarExtension
@@ -180,6 +183,16 @@ def test_asset_ext_add_to(self) -> None:
180183

181184
self.assertIn(SarExtension.get_schema_uri(), item.stac_extensions)
182185

186+
def test_should_return_none_when_observation_direction_is_not_set(self) -> None:
187+
extension = SarExtension.ext(self.item)
188+
extension.apply(
189+
choice(ascii_letters),
190+
choice(list(sar.FrequencyBand)),
191+
[],
192+
choice(ascii_letters),
193+
)
194+
self.assertIsNone(extension.observation_direction)
195+
183196

184197
if __name__ == "__main__":
185198
unittest.main()

0 commit comments

Comments
 (0)