Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 2 additions & 6 deletions packages/python-sdk/tests/test_volume_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ def reset_volume_transports():
reset_transport_caches()


def test_sync_client_requires_volume_token(monkeypatch):
monkeypatch.setenv("E2B_ACCESS_TOKEN", "env-access-token")

def test_sync_client_requires_volume_token():
with pytest.raises(AuthenticationException):
get_sync_api_client(VolumeConnectionConfig())


def test_async_client_requires_volume_token(monkeypatch):
monkeypatch.setenv("E2B_ACCESS_TOKEN", "env-access-token")

def test_async_client_requires_volume_token():
with pytest.raises(AuthenticationException):
get_async_api_client(VolumeConnectionConfig())

Expand Down
8 changes: 2 additions & 6 deletions packages/python-sdk/tests/test_volume_connection_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,13 @@ def test_volume_api_url_custom_domain_in_args():
assert config.api_url == "https://api.custom.com"


def test_volume_token_does_not_fall_back_to_access_token_env(monkeypatch):
monkeypatch.setenv("E2B_ACCESS_TOKEN", "env-access-token")

def test_volume_token_defaults_to_none():
config = VolumeConnectionConfig()
assert config.token is None
Comment thread
mishushakov marked this conversation as resolved.
Resolved
assert config.access_token is None


def test_volume_token_in_args(monkeypatch):
monkeypatch.setenv("E2B_ACCESS_TOKEN", "env-access-token")

def test_volume_token_in_args():
config = VolumeConnectionConfig(token="vol-token")
assert config.token == "vol-token"
assert config.access_token == "vol-token"
Expand Down
Loading