Skip to content

Commit

Permalink
Update test from development
Browse files Browse the repository at this point in the history
  • Loading branch information
Gal Topper committed Sep 19, 2023
1 parent 2a20cc5 commit 5a2c309
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions clients/py/tests/test_v3io_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from contextlib import contextmanager

from os import environ
import pytest

import v3io_frames as v3f

Expand Down Expand Up @@ -45,7 +44,8 @@ def test_client_env():
url = 'localhost:8080'
data = json.dumps({'url': url})
with setenv(v3f.SESSION_ENV_KEY, data):
c = v3f.Client('localhost:8081', should_check_version=False)
with setenv("V3IO_API", ""):
c = v3f.Client('localhost:8081', should_check_version=False)

assert c.session.url == url, 'missing URL from env'

Expand All @@ -54,11 +54,9 @@ def test_session_from_env():
obj = {field.name: field.name for field in v3f.Session.DESCRIPTOR.fields}
data = json.dumps(obj)
with setenv(v3f.SESSION_ENV_KEY, data):
s = v3f.session_from_env()
with setenv("V3IO_API", ""):
with setenv("V3IO_ACCESS_KEY", ""):
s = v3f.session_from_env()

env_obj = {field.name: value for field, value in s.ListFields()}
assert env_obj == obj, 'bad session from environment'

with pytest.raises(ValueError):
with setenv(v3f.SESSION_ENV_KEY, '"'):
v3f.session_from_env()

0 comments on commit 5a2c309

Please sign in to comment.