From 77fef622eb94dc5a7eeb148c23c82b10e9e36ce5 Mon Sep 17 00:00:00 2001 From: kissiel Date: Fri, 20 Oct 2023 18:24:00 +0200 Subject: [PATCH] mock the RemoteSessionAssistant entirely (BugFix) (#776) mock the RemoteSessionAssistant entirely --- checkbox-ng/plainbox/impl/session/test_remote_assistant.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/checkbox-ng/plainbox/impl/session/test_remote_assistant.py b/checkbox-ng/plainbox/impl/session/test_remote_assistant.py index 350c1ee4d..67c8dd694 100644 --- a/checkbox-ng/plainbox/impl/session/test_remote_assistant.py +++ b/checkbox-ng/plainbox/impl/session/test_remote_assistant.py @@ -49,7 +49,7 @@ def not_allowed(self, *args): class RemoteAssistantFinishJobTests(TestCase): def setUp(self): - self.rsa = remote_assistant.RemoteSessionAssistant("") + self.rsa = mock.MagicMock() self.rsa._sa = mock.Mock() self.rsa._be = None @@ -61,7 +61,7 @@ def test_no_result_after_auto_resume(self, MockJobResultBuilder): mock_builder = MockJobResultBuilder.return_value mock_builder.get_result.return_value = IJobResult.OUTCOME_PASS - result = self.rsa.finish_job() + result = remote_assistant.RemoteSessionAssistant.finish_job(self.rsa) self.rsa._sa.use_job_result.assert_called_with("job_id", "pass") self.assertEqual(result, IJobResult.OUTCOME_PASS) @@ -79,7 +79,7 @@ def test_no_result_with_be(self): self.rsa._be.wait().get_result = wait_get_result_res wait_get_result_res.return_value = IJobResult.OUTCOME_PASS - result = self.rsa.finish_job() + result = remote_assistant.RemoteSessionAssistant.finish_job(self.rsa) self.assertTrue(self.rsa._be.wait.called) self.assertTrue(self.rsa._be.wait().get_result)