Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from hotdata_runtime.client import HotdataClient


def _clear_workspace_env(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.delenv("HOTDATA_WORKSPACE", raising=False)


@pytest.mark.parametrize(
("raw", "expected"),
[
Expand Down Expand Up @@ -44,9 +48,8 @@ def test_resolve_workspace_selection_prefers_env_without_listing(
assert resolved.workspaces == []



def test_pick_workspace_chooses_first_active(monkeypatch: pytest.MonkeyPatch):
monkeypatch.delenv("HOTDATA_WORKSPACE", raising=False)
_clear_workspace_env(monkeypatch)

items = [
SimpleNamespace(public_id="ws_1", active=False),
Expand All @@ -61,7 +64,7 @@ def test_pick_workspace_chooses_first_active(monkeypatch: pytest.MonkeyPatch):


def test_pick_workspace_falls_back_to_first(monkeypatch: pytest.MonkeyPatch):
monkeypatch.delenv("HOTDATA_WORKSPACE", raising=False)
_clear_workspace_env(monkeypatch)

items = [
SimpleNamespace(public_id="ws_1", active=False),
Expand All @@ -75,7 +78,7 @@ def test_pick_workspace_falls_back_to_first(monkeypatch: pytest.MonkeyPatch):


def test_resolve_workspace_selection_source_first(monkeypatch: pytest.MonkeyPatch):
monkeypatch.delenv("HOTDATA_WORKSPACE", raising=False)
_clear_workspace_env(monkeypatch)
items = [
SimpleNamespace(public_id="ws_1", active=False),
SimpleNamespace(public_id="ws_2", active=False),
Expand All @@ -94,7 +97,7 @@ def test_resolve_workspace_selection_source_first(monkeypatch: pytest.MonkeyPatc
def test_resolve_workspace_selection_returns_workspaces_and_source(
monkeypatch: pytest.MonkeyPatch,
):
monkeypatch.delenv("HOTDATA_WORKSPACE", raising=False)
_clear_workspace_env(monkeypatch)

items = [
SimpleNamespace(public_id="ws_1", active=False),
Expand Down
Loading