本文整理汇总了Python中vilya.models.project.CodeDoubanProject.create_git_repo方法的典型用法代码示例。如果您正苦于以下问题:Python CodeDoubanProject.create_git_repo方法的具体用法?Python CodeDoubanProject.create_git_repo怎么用?Python CodeDoubanProject.create_git_repo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.project.CodeDoubanProject
的用法示例。
在下文中一共展示了CodeDoubanProject.create_git_repo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_git_repo
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import create_git_repo [as 别名]
def test_create_git_repo(self):
git_path = os.path.join(get_repo_root(), "abc.git")
CodeDoubanProject.create_git_repo(git_path)
assert os.path.exists(git_path)
info_file = os.path.join(git_path, "refs")
assert os.path.exists(info_file)
shutil.rmtree(git_path)
示例2: _repo
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import create_git_repo [as 别名]
def _repo(self, name, bare=True):
git_path = self._path(name)
if bare:
work_tree_path = None
else:
work_tree_path = self._path_work_tree(name)
os.mkdir(work_tree_path)
CodeDoubanProject.create_git_repo(git_path)
repo = git.GitRepo(git_path, work_tree=work_tree_path)
return repo
示例3: test_create
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import create_git_repo [as 别名]
def test_create(self):
git_path = os.path.join(get_repo_root(), 'test_create.git')
assert not os.path.exists(
git_path), "git_path should not exist prior repo creation"
CodeDoubanProject.create_git_repo(git_path)
assert os.path.exists(
git_path), "create_git_repo should create git_path"
refs_file = os.path.join(git_path, 'refs')
assert os.path.exists(refs_file), \
"create_git_repo should create a git repo with refs subdir"
示例4: _repo
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import create_git_repo [as 别名]
def _repo(self, name, bare=True):
git_path = self._path(name)
if bare:
work_tree_path = None
else:
work_tree_path = self._path_work_tree(name)
if not os.path.exists(work_tree_path):
os.mkdir(work_tree_path)
try:
CodeDoubanProject.create_git_repo(git_path)
except:
pass
repo = git.GitRepo(git_path, work_tree=work_tree_path)
return repo
示例5: _repo
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import create_git_repo [as 别名]
def _repo(self, name, bare=True):
git_path = self._path(name)
if bare:
work_tree_path = None
else:
work_tree_path = self._path_work_tree(name)
if os.path.exists(git_path):
shutil.rmtree(git_path, ignore_errors=True)
try:
os.mkdir(work_tree_path)
except OSError:
pass
CodeDoubanProject.create_git_repo(git_path)
repo = git.GitRepo(git_path, work_tree=work_tree_path)
return repo
示例6: test_gitrepo_path
# 需要导入模块: from vilya.models.project import CodeDoubanProject [as 别名]
# 或者: from vilya.models.project.CodeDoubanProject import create_git_repo [as 别名]
def test_gitrepo_path(self):
git_path = self._path('test_gitrepo_path')
CodeDoubanProject.create_git_repo(git_path)
repo = git.GitRepo(git_path)
assert repo.path == git_path, "repo.path should be equal to git_path"