@@ -60,8 +60,8 @@ async def test_nested_node_creation(a):
6060 specs = [],
6161 )
6262 c = await b .lookup_adapter (["c" ])
63- assert b . segments == ["b" ]
64- assert c . segments == ["b" , "c" ]
63+ assert await b . path_segments () == ["b" ]
64+ assert await c . path_segments () == ["b" , "c" ]
6565 assert (await a .keys_range (0 , 1 )) == ["b" ]
6666 assert (await b .keys_range (0 , 1 )) == ["c" ]
6767 # smoke test
@@ -344,7 +344,7 @@ async def test_delete_tree(tmpdir):
344344 d .write_array ([7 , 8 , 9 ])
345345
346346 nodes_before_delete = (await tree .context .execute ("SELECT * from nodes" )).all ()
347- assert len (nodes_before_delete ) == 7
347+ assert len (nodes_before_delete ) == 7 + 1 # +1 for the root node
348348 data_sources_before_delete = (
349349 await tree .context .execute ("SELECT * from data_sources" )
350350 ).all ()
@@ -361,7 +361,7 @@ async def test_delete_tree(tmpdir):
361361 await tree .delete_tree (external_only = False )
362362
363363 nodes_after_delete = (await tree .context .execute ("SELECT * from nodes" )).all ()
364- assert len (nodes_after_delete ) == 0
364+ assert len (nodes_after_delete ) == 0 + 1 # the root node that should remain
365365 data_sources_after_delete = (
366366 await tree .context .execute ("SELECT * from data_sources" )
367367 ).all ()
@@ -371,7 +371,7 @@ async def test_delete_tree(tmpdir):
371371
372372
373373@pytest .mark .asyncio
374- async def test_access_control (tmpdir ):
374+ async def test_access_control (tmpdir , sqlite_or_postgres_uri ):
375375 config = {
376376 "authentication" : {
377377 "allow_anonymous_access" : True ,
@@ -410,7 +410,7 @@ async def test_access_control(tmpdir):
410410 "tree" : "catalog" ,
411411 "path" : "/" ,
412412 "args" : {
413- "uri" : f"sqlite:/// { tmpdir } /catalog.db" ,
413+ "uri" : sqlite_or_postgres_uri ,
414414 "writable_storage" : str (tmpdir / "data" ),
415415 "init_if_not_exists" : True ,
416416 },
@@ -536,7 +536,7 @@ async def test_constraints_on_parameter_and_num(a, assets):
536536
537537
538538@pytest .mark .asyncio
539- async def test_init_db_logging (tmpdir , caplog ):
539+ async def test_init_db_logging (sqlite_or_postgres_uri , tmpdir , caplog ):
540540 config = {
541541 "database" : {
542542 "uri" : "sqlite://" , # in-memory
@@ -546,7 +546,7 @@ async def test_init_db_logging(tmpdir, caplog):
546546 "tree" : "catalog" ,
547547 "path" : "/" ,
548548 "args" : {
549- "uri" : f"sqlite:/// { tmpdir } /catalog.db" ,
549+ "uri" : sqlite_or_postgres_uri ,
550550 "writable_storage" : str (tmpdir / "data" ),
551551 "init_if_not_exists" : True ,
552552 },
0 commit comments