Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed Jan 4, 2024
1 parent 33243f3 commit 50a3843
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_irods_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ def test_init_irods(mocksession, fs):
iRODSCommon()._init_irods()
mocksession.assert_called()

@patch("cubi_tk.irods_common.iRODSCommon._init_irods")
def test_get_irods_sessions(mockinit):
with iRODSCommon()._get_irods_sessions(count = 4) as sessions:
[s for s in sessions]
assert mockinit.call_count == 4

mockinit.reset_mock()
with iRODSCommon()._get_irods_sessions(count = -1) as sessions:
[s for s in sessions]
assert mockinit.call_count == 1

@patch("getpass.getpass")
@patch("cubi_tk.irods_common.iRODSSession")
Expand Down Expand Up @@ -65,7 +75,6 @@ def test_save_irods_token(mocksession, mockencode, fs):
assert icommon.irods_env_path.parent.joinpath(".irodsA").exists()
mockencode.assert_called_with("secure")


# Test iRODSTransfer #########
@pytest.fixture
def jobs():
Expand Down

0 comments on commit 50a3843

Please sign in to comment.