Skip to content

Commit 0509974

Browse files
committed
adapt tests
1 parent 5037109 commit 0509974

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/simcore-sdk/tests/unit/test_node_ports_v2_port.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class PortParams(NamedTuple):
300300
new_value=str(this_node_file_name()),
301301
exp_new_value=FileLink(
302302
store=simcore_store_id(),
303-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
303+
path=f"{project_id()}/{node_uuid()}/no_file/{this_node_file_name().name}",
304304
e_tag=e_tag(),
305305
),
306306
exp_new_get_value=download_file_folder_name()
@@ -323,7 +323,7 @@ class PortParams(NamedTuple):
323323
new_value=this_node_file_name(),
324324
exp_new_value=FileLink(
325325
store=simcore_store_id(),
326-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
326+
path=f"{project_id()}/{node_uuid()}/no_file_with_default/{this_node_file_name().name}",
327327
e_tag=e_tag(),
328328
),
329329
exp_new_get_value=download_file_folder_name()
@@ -392,7 +392,7 @@ class PortParams(NamedTuple):
392392
key="some_file_on_datcore",
393393
value={
394394
"store": datcore_store_id(),
395-
"path": f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
395+
"path": f"{project_id()}/{node_uuid()}/some_file_on_datcore/{this_node_file_name().name}",
396396
"dataset": "some blahblah",
397397
"label": "some blahblah",
398398
},
@@ -401,7 +401,7 @@ class PortParams(NamedTuple):
401401
exp_value_converter=Path,
402402
exp_value=FileLink(
403403
store=datcore_store_id(),
404-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
404+
path=f"{project_id()}/{node_uuid()}/some_file_on_datcore/{this_node_file_name().name}",
405405
dataset="some blahblah",
406406
label="some blahblah",
407407
),
@@ -411,7 +411,7 @@ class PortParams(NamedTuple):
411411
new_value=this_node_file_name(),
412412
exp_new_value=FileLink(
413413
store=simcore_store_id(),
414-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
414+
path=f"{project_id()}/{node_uuid()}/some_file_on_datcore/{this_node_file_name().name}",
415415
e_tag=e_tag(),
416416
),
417417
exp_new_get_value=download_file_folder_name()
@@ -440,7 +440,7 @@ class PortParams(NamedTuple):
440440
new_value=this_node_file_name(),
441441
exp_new_value=FileLink(
442442
store=simcore_store_id(),
443-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
443+
path=f"{project_id()}/{node_uuid()}/download_link/{this_node_file_name().name}",
444444
e_tag=e_tag(),
445445
),
446446
exp_new_get_value=download_file_folder_name()
@@ -472,7 +472,7 @@ class PortParams(NamedTuple):
472472
new_value=this_node_file_name(),
473473
exp_new_value=FileLink(
474474
store=simcore_store_id(),
475-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
475+
path=f"{project_id()}/{node_uuid()}/download_link_with_file_to_key/{this_node_file_name().name}",
476476
e_tag=e_tag(),
477477
),
478478
exp_new_get_value=download_file_folder_name()
@@ -503,7 +503,7 @@ class PortParams(NamedTuple):
503503
new_value=this_node_file_name(),
504504
exp_new_value=FileLink(
505505
store=simcore_store_id(),
506-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
506+
path=f"{project_id()}/{node_uuid()}/file_port_link/{this_node_file_name().name}",
507507
e_tag=e_tag(),
508508
),
509509
exp_new_get_value=download_file_folder_name()
@@ -537,7 +537,7 @@ class PortParams(NamedTuple):
537537
new_value=this_node_file_name(),
538538
exp_new_value=FileLink(
539539
store=simcore_store_id(),
540-
path=f"{project_id()}/{node_uuid()}/{this_node_file_name().name}",
540+
path=f"{project_id()}/{node_uuid()}/file_port_link_with_file_to_key_map/{this_node_file_name().name}",
541541
e_tag=e_tag(),
542542
),
543543
exp_new_get_value=download_file_folder_name()
@@ -643,7 +643,7 @@ async def save_to_db_cb(node_ports):
643643
exp_get_value.touch()
644644

645645
if exp_get_value is None:
646-
assert await port.get() == None
646+
assert await port.get() is None
647647
else:
648648
assert await port.get() == exp_get_value
649649
if isinstance(exp_value, PortLink) and isinstance(exp_get_value, Path):
@@ -661,7 +661,7 @@ async def save_to_db_cb(node_ports):
661661
exp_new_get_value.parent.mkdir(parents=True, exist_ok=True)
662662
exp_new_get_value.touch()
663663
if exp_new_get_value is None:
664-
assert await port.get() == None
664+
assert await port.get() is None
665665
else:
666666
assert await port.get() == exp_new_get_value
667667
assert await port.get() == exp_new_get_value
@@ -728,4 +728,4 @@ async def test_invalid_file_type_setter(
728728

729729
# set a folder fails too
730730
with pytest.raises(exceptions.InvalidItemTypeError):
731-
await port.set_value(Path(__file__).parent)
731+
await port.set_value(f"{Path(__file__).parent}")

0 commit comments

Comments
 (0)