Skip to content

Commit

Permalink
Add unit tests for SessionAssistant
Browse files Browse the repository at this point in the history
  • Loading branch information
pieqq committed Mar 15, 2024
1 parent cd6ec93 commit aa01dfb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions checkbox-ng/plainbox/impl/session/test_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,27 @@ def test_bootstrap(self, mock_tpu, mock_su, mock_get_providers):
self_mock._context.state.update_desired_job_list.call_count,
2
)

@mock.patch("plainbox.impl.session.state.select_units")
def test_hand_pick_jobs(self, mock_su, mock_get_providers):
self_mock = mock.MagicMock()
SessionAssistant.hand_pick_jobs(self_mock, [])
self.assertEqual(
self_mock._context.state.update_desired_job_list.call_count,
1
)

@mock.patch("plainbox.impl.session.state.select_units")
@mock.patch("plainbox.impl.unit.testplan.TestPlanUnit")
def test_get_bootstrap_todo_list(
self,
mock_tpu,
mock_su,
mock_get_providers
):
self_mock = mock.MagicMock()
SessionAssistant.get_bootstrap_todo_list(self_mock)
self.assertEqual(
self_mock._context.state.update_desired_job_list.call_count,
1
)

0 comments on commit aa01dfb

Please sign in to comment.