Skip to content

Commit 2070566

Browse files
committed
Add test for missing url in Client.open
1 parent 151a1f4 commit 2070566

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ def test_environment_variable(self):
110110
else:
111111
del os.environ["STAC_URL"]
112112

113+
def test_no_url(self):
114+
old_stac_url = os.environ.get("STAC_URL")
115+
if old_stac_url:
116+
del os.environ["STAC_URL"]
117+
try:
118+
with pytest.raises(TypeError):
119+
Client.open()
120+
finally:
121+
if old_stac_url:
122+
os.environ["STAC_URL"] = old_stac_url
123+
113124

114125
class TestAPISearch:
115126
@pytest.fixture(scope='function')

0 commit comments

Comments
 (0)