def test_non_existing_config(self): assert getconfig('non.existing.config') is None
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']
def test_remote_url(self): check_call(['git', 'remote', 'add', 'origin', '/dev/null']) assert getconfig('remote.origin.url') == '/dev/null'
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
def test_mangle_always(self, mangle='always'): self.cli_init(mangle=mangle) assert self.is_configured() assert getconfig('blackhole.{}.repokey'.format(self.remote))
def is_configured(self): config = 'remote.{}.url'.format(self.remote) return getconfig(config) is not None