Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Berenbaum committed Jul 12, 2024
1 parent 7ec3fb3 commit 4ca848f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class CloudTestCatalog:
server: CloudServer
working_dir: PosixPath
catalog: Catalog
session: Session

@property
def src(self):
Expand Down Expand Up @@ -432,7 +433,10 @@ def get_cloud_test_catalog(cloud_server, tmp_path, id_generator, metastore, ware
tmp_dir=str(tmpfile_dir),
client_config=cloud_server.client_config,
)
return CloudTestCatalog(server=cloud_server, working_dir=tmp_path, catalog=catalog)
session = Session.get(catalog=catalog)
return CloudTestCatalog(
server=cloud_server, working_dir=tmp_path, catalog=catalog, session=session
)


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions tests/func/test_datachain.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_catalog_anon(catalog, anon):

def test_from_storage(cloud_test_catalog):
ctc = cloud_test_catalog
dc = DataChain.from_storage(ctc.src_uri, catalog=ctc.catalog)
dc = DataChain.from_storage(ctc.src_uri, session=ctc.session)
assert dc.count() == 7


Expand All @@ -27,7 +27,7 @@ def new_signal(file: File) -> str:
with file.open() as f:
return file.name + " -> " + f.read().decode("utf-8")

dc = DataChain.from_storage(ctc.src_uri, catalog=ctc.catalog).map(signal=new_signal)
dc = DataChain.from_storage(ctc.src_uri, session=ctc.session).map(signal=new_signal)
expected = {
"description -> Cats and Dogs",
"cat1 -> meow",
Expand Down

0 comments on commit 4ca848f

Please sign in to comment.