

@mock.patch('bareon.utils.grub.os.path.isfile')
def test_guess_grub2_default(self, mock_isfile):
    side_effect_values = {
        '/target/etc/default/grub': True,
        '/target/etc/sysconfig/grub': False,
    }

    def side_effect(key):
        return side_effect_values[key]
    self.side_effect = side_effect
    self.assertEqual(gu.guess_grub2_default('/target'), '/etc/default/grub')
    side_effect_values = {
        '/target/etc/default/grub': False,
        '/target/etc/sysconfig/grub': True,
    }
    self.assertEqual(gu.guess_grub2_default('/target'), '/etc/sysconfig/grub')

dataset/ETHPy150Open openstack/bareon/bareon/tests/test_grub_utils.py TestGrubUtils.test_guess_grub2_default/VarMisuse@52/103 `mock_isfile`->`self`