From 6a43599178cf959b9d1255c6cb2b7020dc28ba92 Mon Sep 17 00:00:00 2001 From: Anindya Roy Date: Wed, 13 Dec 2023 16:13:01 +0530 Subject: [PATCH] NXDRIVE-2860: Code Coverage - added test cases to test_remote_client 13/12 -- 4 --- tests/functional/test_remote_client.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/functional/test_remote_client.py b/tests/functional/test_remote_client.py index 7033d7241c..ba7188a887 100644 --- a/tests/functional/test_remote_client.py +++ b/tests/functional/test_remote_client.py @@ -274,17 +274,17 @@ def get_upload_(*args, **kwargs): return mocked_upload_obj_ obj1_ = Mock() - returned_val = None with manager: with patch.object(Action, "get_current_action", new=get_current_action_): with patch.object(remote.dao, "get_download", new=get_download_): with patch.object( remote.dao, "set_transfer_progress", new=set_transfer_progress_ ): - returned_val = remote.transfer_end_callback(obj1_) with pytest.raises(Exception) as err: + remote.transfer_end_callback(obj1_) assert err with patch.object(Action, "get_current_action", new=get_current_action__): - with patch.object(remote.dao, "get_download", new=get_upload_): - returned_val = remote.transfer_end_callback(obj1_) - assert not returned_val + with patch.object(remote.dao, "get_upload", new=get_upload_): + with pytest.raises(Exception) as err: + remote.transfer_end_callback(obj1_) + assert err