

@mock.patch('bareon.utils.grub.utils.execute')
@mock.patch('bareon.utils.grub.guess_grub_install')
def test_grub2_install(self, mock_guess_grub, mock_exec):
    mock_guess_grub.return_value = '/sbin/grub'
    expected_calls = [mock.call('chroot', '/target', '/sbin/grub', '/dev/foo', run_as_root=True, check_exit_code=[0]), mock.call('chroot', '/target', '/sbin/grub', '/dev/bar', run_as_root=True, check_exit_code=[0])]
    gu.grub2_install(['/dev/foo', '/dev/bar'], chroot='/target')
    self.assertEqual(mock_exec.call_args_list, expected_calls)

dataset/ETHPy150Open openstack/bareon/bareon/tests/test_grub_utils.py TestGrubUtils.test_grub2_install/original