

def test_present_failure(self):
    '\n        git.present\n        '
    name = os.path.join(integration.TMP, 'salt_repo')
    if (not os.path.isdir(name)):
        os.mkdir(name)
    try:
        fname = os.path.join(name, 'stoptheprocess')
        with salt.utils.fopen(fname, 'a') as fh_:
            fh_.write('')
        ret = self.run_state('git.present', name=name, bare=True)
        self.assertSaltFalseReturn(ret)
        self.assertFalse(os.path.isfile(os.path.join(name, 'HEAD')))
    finally:
        shutil.rmtree(name, ignore_errors=True)

dataset/ETHPy150Open saltstack/salt/tests/integration/states/git.py GitTest.test_present_failure/original