

@mock.patch('bareon.utils.grub.guess_grub_install')
@mock.patch('bareon.utils.grub.utils.execute')
def test_guess_grub_version_1(self, mock_exec, mock_ggi):
    mock_ggi.return_value = '/grub_install'
    mock_exec.return_value = ('foo 0.97 bar', '')
    version = gu.guess_grub_version('/target')
    cmd = 'chroot /target /grub_install --version'.split()
    mock_exec.assert_called_once_with(*cmd)
    self.assertEqual(version, 1)

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