

def test_grub1_cfg_kernel_initrd_are_set(self):
    config = '\ndefault=0\ntimeout=10\ntitle Default (kernel-version-set)\n    kernel /kernel-version-set kernel-params\n    initrd /initrd-version-set\n    '
    mock_open = mock.mock_open()
    with mock.patch('bareon.utils.grub.open', new=self, create=True):
        gu.grub1_cfg(kernel='kernel-version-set', initrd='initrd-version-set', chroot='/target', kernel_params='kernel-params', grub_timeout=10)
    mock_open.assert_called_once_with('/target/boot/grub/grub.conf', 'wt', encoding='utf-8')
    mock_open_file = mock_open()
    mock_open_file.write.assert_called_once_with(config)

dataset/ETHPy150Open openstack/bareon/bareon/tests/test_grub_utils.py TestGrubUtils.test_grub1_cfg_kernel_initrd_are_set/VarMisuse@31/109 `mock_open`->`self`