Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed Nov 7, 2023
1 parent 95c76ab commit 6b72d9d
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions tests/test_irods_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ def fake_filesystem(fs):
@pytest.fixture
def jobs():
return (
TransferJob(
path_src="myfile.csv",
path_dest="dest_dir/myfile.csv",
bytes=123,
md5="ed3b3cbb18fd148bc925944ff0861ce6",
),
TransferJob(
path_src="folder/file.csv",
path_dest="dest_dir/folder/file.csv",
bytes=1024,
md5="a6e9e3c859b803adb0f1d5f08a51d0f6",
),
TransferJob(path_src="myfile.csv", path_dest="dest_dir/myfile.csv", bytes=123),
TransferJob(path_src="folder/file.csv", path_dest="dest_dir/folder/file.csv", bytes=1024),
)


Expand All @@ -56,7 +46,7 @@ def test_get_irods_error():
assert get_irods_error(e) == "Connection reset"


@patch("cubi_tk.irods_utils.iRODSSession")
@patch("cubi_tk.irods_common.iRODSSession")
@patch("getpass.getpass")
def test_init_irods(mockpass, mocksession, fs):
ienv = Path(".irods/irods_environment.json")
Expand All @@ -76,7 +66,7 @@ def test_init_irods(mockpass, mocksession, fs):
mocksession.assert_called_with(irods_env_file=ienv)


@patch("cubi_tk.irods_utils.encode", return_value="it works")
@patch("cubi_tk.irods_common.encode", return_value="it works")
def test_write_token(mockencode, fs):
ienv = Path(".irods/irods_environment.json")

Expand Down Expand Up @@ -104,9 +94,6 @@ def test_irods_transfer_put(fs, itransfer, jobs):

for job in jobs:
assert Path(job.path_dest).exists()
assert Path(job.path_dest + ".md5").exists()
with Path(job.path_dest + ".md5").open() as file:
assert file.readline() == f"{job.md5} {Path(job.path_dest).name}"


def test_irods_transfer_chksum(itransfer):
Expand Down

0 comments on commit 6b72d9d

Please sign in to comment.