Exemple #1
0
 def test_non_existing_config(self):
     assert getconfig('non.existing.config') is None
Exemple #2
0
 def test_multivar(self):
     check_call(['git', 'config', '--add', 'spam.egg', 'super'])
     check_call(['git', 'config', '--add', 'spam.egg', 'delicious'])
     assert getconfig('spam.egg', aslist=True) == ['super', 'delicious']
Exemple #3
0
 def test_remote_url(self):
     check_call(['git', 'remote', 'add', 'origin', '/dev/null'])
     assert getconfig('remote.origin.url') == '/dev/null'
Exemple #4
0
 def test_explicit_repokey(self, **kwargs):
     repokey = 'explicit-repokey'
     self.cli_init(repokey=repokey, **kwargs)
     assert self.is_configured()
     assert getconfig('blackhole.{}.repokey'.format(self.remote)) == repokey
Exemple #5
0
 def test_mangle_always(self, mangle='always'):
     self.cli_init(mangle=mangle)
     assert self.is_configured()
     assert getconfig('blackhole.{}.repokey'.format(self.remote))
Exemple #6
0
 def is_configured(self):
     config = 'remote.{}.url'.format(self.remote)
     return getconfig(config) is not None