当前位置: 首页>>代码示例>>Python>>正文


Python helpers.fake_commit函数代码示例

本文整理汇总了Python中tests.helpers.fake_commit函数的典型用法代码示例。如果您正苦于以下问题:Python fake_commit函数的具体用法?Python fake_commit怎么用?Python fake_commit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fake_commit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的tests.helpers.fake_commit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。