'Various exit path tests for test_add_repo'

def test_add_repo(self):

    with self.assertRaises(GitImportErrorNoDir):
        git_import.add_repo(self.TEST_REPO, None, None)
    os.mkdir(self.git_repo_dir)
    self.addCleanup(shutil.rmtree, self.git_repo_dir)
    with self.assertRaises(GitImportErrorUrlBad):
        git_import.add_repo('foo', None, None)
    with self.assertRaises(GitImportErrorCannotPull):
        git_import.add_repo('file:///foobar.git', None, None)
    bare_repo = os.path.abspath('{0}/{1}'.format(settings.TEST_ROOT, 'bare.git'))
    os.mkdir(bare_repo)
    self.addCleanup(shutil.rmtree, bare_repo)
    subprocess.check_output(['git', '--bare', 'init'], stderr=subprocess.STDOUT, cwd=bare_repo)
    with self.assertRaises(GitImportErrorBadRepo):
        git_import.add_repo('file://{0}'.format(bare_repo), None, None)
