Skip to content

Commit

Permalink
mock the RemoteSessionAssistant entirely (BugFix) (#776)
Browse files Browse the repository at this point in the history
mock the RemoteSessionAssistant entirely
  • Loading branch information
kissiel authored Oct 20, 2023
1 parent 548d2e7 commit 77fef62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions checkbox-ng/plainbox/impl/session/test_remote_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 77fef62

Please sign in to comment.