def _get_code_dir_url(repo, config): repos = list_repos(config) if repo not in repos: raise RepoNotFoundException data = config['repos'][repo] url = data['url'] code_dir = _get_code_dir_from_url(url) return code_dir, url
def _install_repo(repo, config=None, git_command=None): repos = list_repos(config) config = get_config(config) if repo not in repos: raise RepoNotFoundException data = config['repos'][repo] if not git_command: git_command = __git_command url = data['url'] code_dir = get_code_dir(url) if os.path.exists(code_dir): raise RepoAlreadyInstalledException( "Something already exists in {}. " "What more do you want?".format(code_dir)) if not os.path.exists(_get_code_base_dir()): raise WheeljackCodeDirectoryMissing return git_command(url)
def test_list_repos(self): expected = ['nuggets', 'wheeljack'] config = yaml.load(DUMMY_CONFIG) eq_(expected, list_repos(config))