2014-11-18 19:00:29 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2014-11-20 16:15:56 +00:00
|
|
|
# Import Python Libs
|
2014-11-21 19:05:13 +00:00
|
|
|
from __future__ import absolute_import
|
2014-11-18 19:00:29 +00:00
|
|
|
import shutil
|
|
|
|
import subprocess
|
|
|
|
import tempfile
|
|
|
|
|
|
|
|
# Import Salt Testing libs
|
2014-11-19 16:59:29 +00:00
|
|
|
from salttesting.helpers import ensure_in_syspath, skip_if_binaries_missing
|
|
|
|
ensure_in_syspath('../..')
|
2014-11-18 19:00:29 +00:00
|
|
|
|
|
|
|
# Import salt libs
|
|
|
|
import integration
|
|
|
|
|
|
|
|
|
2014-11-19 16:59:29 +00:00
|
|
|
@skip_if_binaries_missing('git')
|
2014-11-18 19:00:29 +00:00
|
|
|
class GitModuleTest(integration.ModuleCase):
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
self.repos = tempfile.mkdtemp(dir=integration.TMP)
|
|
|
|
self.addCleanup(shutil.rmtree, self.repos, ignore_errors=True)
|
|
|
|
subprocess.check_call(['git', 'init', '--quiet', self.repos])
|
|
|
|
|
|
|
|
def test_config_set_value_has_space_characters(self):
|
|
|
|
'''
|
2014-11-20 16:15:56 +00:00
|
|
|
Tests the git.config_set function
|
2014-11-18 19:00:29 +00:00
|
|
|
'''
|
|
|
|
config_key = "user.name"
|
|
|
|
config_value = "foo bar"
|
|
|
|
|
|
|
|
ret = self.run_function(
|
|
|
|
'git.config_set',
|
|
|
|
cwd=self.repos,
|
|
|
|
setting_name=config_key,
|
|
|
|
setting_value=config_value,
|
|
|
|
)
|
|
|
|
self.assertEqual("", ret)
|