Skip to content

Commit e74da1b

Browse files
committed
Fix tests
1 parent 911dcac commit e74da1b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

ibridges/irodsconnector/meta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,7 @@ def delete(self, key: str, value: Optional[str], units: Optional[str] = None):
121121
"path '{item.path}'.") from error
122122

123123
def clear(self):
124+
"""Delete all metadata belonging to the item.
125+
"""
124126
for meta in self:
125127
self.item.metadata.remove(meta)

ibridges/irodsconnector/tickets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def all_tickets(self, update: bool = False) -> list[tuple[str, str, str, str]]:
104104
return self._all_tickets
105105

106106
def clear(self):
107+
"""Delete all tickets.
108+
"""
107109
self.all_tickets(update=True)
108110
for tick_data in self._all_tickets:
109111
tick_str = tick_data[0]

tests/test_irodspath.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class MockIrodsSession:
1313
server_version = "test_version"
1414
port = 9876
1515
home = "/testzone/home/testuser"
16+
irods_session = None
1617
# def home(self):
1718
# return "/"+self.zone+"/home/"+self.user
1819

@@ -40,7 +41,7 @@ class MockIrodsSession:
4041
([PurePosixPath(".", "xyz")], "/testzone/home/testuser/xyz", "xyz", "."),
4142
(["/x/y/z"], "/x/y/z", "z", "/x/y"),
4243
(["/x/y", "z"], "/x/y/z", "z", "/x/y"),
43-
([IrodsPath(123, "/x/y"), "z"], "/x/y/z", "z", "/x/y")
44+
([IrodsPath(MockIrodsSession(), "/x/y"), "z"], "/x/y/z", "z", "/x/y")
4445
# ([PureWindowsPath("c:\\x\\y\\z")], "c:\\/x/y/z", "z", "/x/y")
4546
])
4647
def test_absolute_path(input, abs_path, name, parent):
@@ -56,11 +57,11 @@ def test_absolute_path(input, abs_path, name, parent):
5657
[
5758
("/etc", ["test"], "/etc/test"),
5859
("123", ["test", "test2"], "123/test/test2"),
59-
("~", [IrodsPath(123, "test")], "~/test")
60+
("~", [IrodsPath(MockIrodsSession(), "test")], "~/test")
6061
]
6162
)
6263
def test_join_path(path, to_join, result):
63-
irods_path = IrodsPath(123, path)
64+
irods_path = IrodsPath(MockIrodsSession(), path)
6465
assert str(irods_path.joinpath(*to_join)._path) == result
6566

6667
# Create upload and download path tests for data_operations

0 commit comments

Comments
 (0)