本文整理汇总了Python中tests.helpers.fake_commit函数的典型用法代码示例。如果您正苦于以下问题:Python fake_commit函数的具体用法?Python fake_commit怎么用?Python fake_commit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fake_commit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_feature_finish_rebase
def test_feature_finish_rebase(self):
gitflow = GitFlow('.').init()
gitflow.develop().checkout()
fake_commit(gitflow.repo, 'A commit on devel')
run_git_flow('feature', 'finish', 'even', '--rebase')
self.assertNotIn('feat/even', Repo().branches)
self.assertTrue(gitflow.develop().commit.message.startswith('Finished feature even.\n'))
开发者ID:charness,项目名称:gitflow,代码行数:7,代码来源:test_bin.py
示例2: test_finish_in_new_sandbox
def test_finish_in_new_sandbox(self):
sandbox = create_sandbox(self)
gitflow = GitFlow(sandbox).init()
gitflow.create('feature', 'wow-feature', base=None, fetch=False)
self.assertEqual(gitflow.repo.active_branch.name, 'feature/wow-feature')
fake_commit(gitflow.repo, 'Yet another commit')
gitflow.finish('feature', 'wow-feature', False, False, False, False, None)
self.assertNotIn('feature/wow-feature', gitflow.repo.branches)
开发者ID:OBdA,项目名称:gitflow,代码行数:8,代码来源:test_core.py
示例3: test_feature_list_verbose_rebased
def test_feature_list_verbose_rebased(self):
self.repo.refs['devel'].checkout()
fake_commit(self.repo, 'A commit on devel')
stdout = runGitFlow('feature', 'list', '--verbose', capture=1)
expected = [
' even (may be rebased)',
' recursion (may be rebased)'
]
self.assertEqual(stdout.splitlines(), expected)
开发者ID:opicacek,项目名称:gitflow,代码行数:9,代码来源:test_bin.py
示例4: test_hotfix_list_verbose_tagged
def test_hotfix_list_verbose_tagged(self):
runGitFlow('release', 'finish', '1.0')
runGitFlow('hotfix', 'start', '1.0.1')
fake_commit(self.repo, 'Hotfix commit.')
stdout = runGitFlow('hotfix', 'list', '--verbose', capture=1)
expected = [
'* 1.0.1 (based on v1.0)'
]
self.assertEqual(stdout.splitlines(), expected)
开发者ID:opicacek,项目名称:gitflow,代码行数:9,代码来源:test_bin.py
示例5: test_support_list_verbose_tagged
def test_support_list_verbose_tagged(self):
runGitFlow('release', 'finish', '1.0')
runGitFlow('support', 'start', '1.0-22')
fake_commit(self.repo, 'Support commit.')
stdout = runGitFlow('support', 'list', '--verbose', capture=1)
expected = [
'* 1.0-22 (based on v1.0)'
]
self.assertEqual(stdout.splitlines(), expected)
开发者ID:opicacek,项目名称:gitflow,代码行数:9,代码来源:test_bin.py
示例6: test_feature_list_verbose_ff
def test_feature_list_verbose_ff(self):
self.repo.create_head('devel', 'feat/recursion', force=1)
self.repo.refs['devel'].checkout()
fake_commit(self.repo, 'A commit on devel')
stdout = runGitFlow('feature', 'list', '--verbose', capture=1)
expected = [
' even (may be rebased)',
' recursion (is behind devel, may ff)'
]
self.assertEqual(stdout.splitlines(), expected)
开发者ID:opicacek,项目名称:gitflow,代码行数:10,代码来源:test_bin.py
示例7: test_delete_feature_with_commits_forcefully
def test_delete_feature_with_commits_forcefully(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
self.assertEquals(2, len(mgr.list()))
mgr.create('foo')
fake_commit(self.repo, 'A commit on the feature branch.', append=False)
gitflow.develop().checkout()
self.assertEquals(3, len(mgr.list()))
mgr.delete('foo', force=True)
self.assertEquals(2, len(mgr.list()))
self.assertNotIn('feat/foo', [b.name for b in self.repo.branches])
开发者ID:opicacek,项目名称:gitflow,代码行数:12,代码来源:test_branches.py
示例8: test_finish_release_unresolved_merge_conflict
def test_finish_release_unresolved_merge_conflict(self):
gitflow = GitFlow(self.repo).init()
fmgr = FeatureBranchManager(gitflow)
fmgr.finish('even')
fake_commit(self.repo, 'Overwrite version', filename='VERSION')
mgr = ReleaseBranchManager(gitflow)
self.assertRaises(MergeError,
mgr.finish, '1.0')
# do not resolve, but finish again
self.assertRaises(GitCommandError,
mgr.finish, '1.0')
开发者ID:opicacek,项目名称:gitflow,代码行数:12,代码来源:test_branches.py
示例9: test_delete_release_with_commits_forcefully
def test_delete_release_with_commits_forcefully(self):
gitflow = GitFlow(self.repo)
mgr = ReleaseBranchManager(gitflow)
self.assertEquals(0, len(mgr.list()))
mgr.create('0.7')
fake_commit(self.repo, 'A commit on the release branch.', append=False)
gitflow.develop().checkout()
self.assertEquals(1, len(mgr.list()))
mgr.delete('0.7', force=True)
self.assertEquals(0, len(mgr.list()))
self.assertNotIn('rel/0.7', [b.name for b in self.repo.branches])
开发者ID:opicacek,项目名称:gitflow,代码行数:12,代码来源:test_branches.py
示例10: test_delete_release_with_commits_raises_error
def test_delete_release_with_commits_raises_error(self):
gitflow = GitFlow(self.repo)
mgr = ReleaseBranchManager(gitflow)
self.assertEquals(0, len(mgr.list()))
mgr.create('0.7')
fake_commit(self.repo, 'A commit on the release branch.', append=False)
gitflow.develop().checkout()
self.assertEquals(1, len(mgr.list()))
self.assertRaisesRegexp(GitCommandError,
'The branch .* is not fully merged',
mgr.delete, '0.7')
开发者ID:opicacek,项目名称:gitflow,代码行数:12,代码来源:test_branches.py
示例11: test_compare_branches
def test_compare_branches(self):
gitflow = GitFlow(self.repo).init()
# Branch heads point to the same commit
self.assertEquals(gitflow._compare_branches('devel', 'devel'), 0)
# First given branch needs fast-forwarding
self.assertEquals(gitflow._compare_branches('devel', 'feat/even'), 1)
# Second given branch needs fast-forwarding
self.assertEquals(gitflow._compare_branches('feat/recursion', 'devel'), 2)
# Branch needs a real merge
self.assertEquals(gitflow._compare_branches('feat/even', 'feat/recursion'), 3)
# There is no merge base, i.e. the branches have no common ancestors
gitflow.repo.git.checkout('stable', orphan='orphan')
fake_commit(gitflow.repo, 'Some commit on orphan branch')
self.assertEquals(gitflow._compare_branches('stable', 'orphan'), 4)
开发者ID:chassing,项目名称:gitflow,代码行数:14,代码来源:test_core.py
示例12: test_finish_hotfix
def test_finish_hotfix(self):
gitflow = GitFlow(self.repo)
mgr = HotfixBranchManager(gitflow)
mgr.create('1.2.3')
fake_commit(self.repo, 'Bogus commit')
fake_commit(self.repo, 'Foo commit')
fake_commit(self.repo, 'Fake commit')
fake_commit(self.repo, 'Dummy commit')
mc0 = gitflow.master().commit
dc0 = gitflow.develop().commit
mgr.finish('1.2.3')
mc1 = gitflow.master().commit
dc1 = gitflow.develop().commit
# Hotfix finishes advance both master and develop
self.assertNotEqual(mc0, mc1)
self.assertNotEqual(dc0, dc1)
# Finishing removes the hotfix branch
self.assertNotIn('hf/1.2.3',
[b.name for b in self.repo.branches])
# Merge commit message
self.assertEquals('Finished hotfix 1.2.3.\n', dc1.message)
开发者ID:opicacek,项目名称:gitflow,代码行数:25,代码来源:test_branches.py
示例13: test_delete_already_merged_feature
def test_delete_already_merged_feature(self):
gitflow = GitFlow(self.repo)
mgr = FeatureBranchManager(gitflow)
self.assertEquals(2, len(mgr.list()))
mgr.create('foo')
fake_commit(self.repo, 'Dummy commit #1')
fake_commit(self.repo, 'Dummy commit #2')
mgr.merge('foo', 'devel')
self.assertEquals(3, len(mgr.list()))
mgr.delete('foo')
self.assertEquals(2, len(mgr.list()))
self.assertNotIn('feat/foo', [b.name for b in mgr.list()])
开发者ID:opicacek,项目名称:gitflow,代码行数:14,代码来源:test_branches.py
示例14: test_delete_already_merged_release
def test_delete_already_merged_release(self):
gitflow = GitFlow(self.repo)
mgr = ReleaseBranchManager(gitflow)
self.assertEquals(0, len(mgr.list()))
mgr.create('0.7')
fake_commit(self.repo, 'Dummy commit #1')
fake_commit(self.repo, 'Dummy commit #2')
mgr.merge('0.7', 'devel')
self.assertEquals(1, len(mgr.list()))
mgr.delete('0.7')
self.assertEquals(0, len(mgr.list()))
self.assertNotIn('rel/0.7', [b.name for b in mgr.list()])
开发者ID:opicacek,项目名称:gitflow,代码行数:14,代码来源:test_branches.py
示例15: test_gitflow_pull_really_pulls
def test_gitflow_pull_really_pulls(self):
gitflow = GitFlow(self.repo).init()
self.remote.heads['feat/even'].checkout()
change = fake_commit(self.remote, "Another commit")
self.assertNotIn(change, all_commits(self.repo))
gitflow.pull('feature', 'my-remote', 'even')
self.assertIn(change, all_commits(self.repo))
开发者ID:OBdA,项目名称:gitflow,代码行数:7,代码来源:test_core.py
示例16: test_finish_release_merge_conflict_tag
def test_finish_release_merge_conflict_tag(self):
"""
finish + tag with merge-conflicts on develop
"""
version_filename = 'VERSION'
new_version = '1.1\n'
gitflow = GitFlow(self.repo).init()
fmgr = FeatureBranchManager(gitflow)
fmgr.finish('even')
fake_commit(self.repo, 'Overwrite version',
filename=version_filename,
change=new_version)
# verify that the tag does not yet exist
# "v" comes form "versiontag" prefix in the gitflow config for the "release" fixture
self.assertNotIn('v1.0', self.repo.tags)
mgr = ReleaseBranchManager(gitflow)
taginfo = dict(
message='Tagging version 1.0',
)
self.assertRaises(MergeError,
mgr.finish, '1.0', tagging_info=taginfo)
# verify that the tag exists, even though there was a failed merge
self.assertIn('v1.0', self.repo.tags)
# resolve the conflict
# this is in favor of the change on develop
write_file(filename=version_filename,
append=False,
change=new_version)
gitflow.git.add(version_filename)
gitflow.git.commit('-F.git/MERGE_MSG')
# the release branch is still here
self.assertIn('rel/1.0',
[b.name for b in self.repo.branches])
# finish the release again
# this should skip the tagging, since that part previously succeeded
mgr.finish('1.0', tagging_info=taginfo)
# now the release branch is gone
self.assertNotIn('rel/1.0',
[b.name for b in self.repo.branches])
# verify that the tag still exists
self.assertIn('v1.0', self.repo.tags)
开发者ID:chassing,项目名称:gitflow,代码行数:47,代码来源:test_branches.py
示例17: test_finish_release_merge_conflict
def test_finish_release_merge_conflict(self):
gitflow = GitFlow(self.repo).init()
fmgr = FeatureBranchManager(gitflow)
fmgr.finish('even')
fake_commit(self.repo, 'Overwrite version', filename='VERSION')
mgr = ReleaseBranchManager(gitflow)
self.assertRaises(MergeError,
mgr.finish, '1.0')
# resolve the conflict
gitflow.git.rm('VERSION')
gitflow.git.commit('-F.git/MERGE_MSG')
# the release branch is still here
self.assertIn('rel/1.0',
[b.name for b in self.repo.branches])
mgr.finish('1.0')
# now the release branch is gone
self.assertNotIn('rel/1.0',
[b.name for b in self.repo.branches])
开发者ID:opicacek,项目名称:gitflow,代码行数:19,代码来源:test_branches.py
示例18: test_gitflow_publish_really_pushes
def test_gitflow_publish_really_pushes(self):
gitflow = GitFlow(self.repo).init()
gitflow.create('feature', 'circular', 'devel', fetch=False)
change = fake_commit(self.repo, "Another commit")
all_local_commits = all_commits(self.repo)
self.assertIn(change, all_local_commits)
gitflow.publish('feature', 'circular')
all_remote_commits = all_commits(self.remote)
self.assertEqual(all_remote_commits, all_remote_commits)
self.assertIn(change, all_remote_commits)
开发者ID:OBdA,项目名称:gitflow,代码行数:11,代码来源:test_core.py
示例19: test_finish_fetch_fetches_from_remote
def test_finish_fetch_fetches_from_remote(self):
remote = GitFlow(self.remote).init()
rc0 = remote.develop().commit
gitflow = GitFlow(self.repo).init()
c0 = gitflow.develop().commit
self.assertEqual(rc0, c0)
gitflow.create('feature', 'wow-feature', base=None, fetch=False)
c1 = gitflow.develop().commit
self.assertEqual(c0, c1)
fake_commit(gitflow.repo, 'Yet another commit')
gitflow.finish('feature', 'wow-feature', True, False, False, False, None)
c2 = gitflow.develop().commit
self.assertNotEqual(c0, c2)
fh = self.__get_fetch_head(self.repo)
self.assertEqual(fh, c0)
self.assertNotEqual(fh, c2)
开发者ID:OBdA,项目名称:gitflow,代码行数:20,代码来源:test_core.py
示例20: test_create_release_fetch_from_remote_branch_behind_really_fetches
def test_create_release_fetch_from_remote_branch_behind_really_fetches(self):
rfc0 = self.remote.refs['rel/1.0'].commit
# add a commit to remote rel/1.0 branch
self.remote.refs['rel/1.0'].checkout()
change = fake_commit(self.remote, "Yet another 1.0 commit.")
gitflow = GitFlow(self.repo).init()
mgr = ReleaseBranchManager(gitflow)
mgr.create('1.0', fetch=True)
# must not advance rel/1.0
self.assertEqual(self.repo.refs['rel/1.0'].commit, rfc0)
# change must nor be in local repo
self.assertNotIn(change, all_commits(self.repo))
开发者ID:opicacek,项目名称:gitflow,代码行数:13,代码来源:test_branches.py
注:本文中的tests.helpers.fake_commit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论