Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 def test_create_new_hotfix_branch_non_default_prefix(self):
     gitflow = GitFlow(self.repo).init()
     mgr = HotfixBranchManager(gitflow)
     new_branch = mgr.create('1.2.3')
     self.assertEqual('hf/1.2.3', mgr.list()[0].name)
     self.assertEqual(new_branch.commit,
                      gitflow.repo.branches['stable'].commit)
Exemplo n.º 3
0
 def test_create_new_hotfix_branch_non_default_prefix(self):
     gitflow = GitFlow(self.repo).init()
     mgr = HotfixBranchManager(gitflow)
     new_branch = mgr.create('1.2.3')
     self.assertEqual('hf/1.2.3', mgr.list()[0].name)
     self.assertEqual(new_branch.commit,
             gitflow.repo.branches['stable'].commit)
Exemplo n.º 4
0
 def test_create_new_hotfix_branch(self):
     repo = create_git_repo(self)
     gitflow = GitFlow(repo).init()
     mgr = HotfixBranchManager(gitflow)
     self.assertEqual(0, len(mgr.list()))
     new_branch = mgr.create('1.2.3')
     self.assertEqual(1, len(mgr.list()))
     self.assertEqual('hotfix/1.2.3', mgr.list()[0].name)
     self.assertEqual(new_branch.commit,
                      gitflow.repo.branches['master'].commit)
Exemplo n.º 5
0
 def test_create_new_hotfix_branch(self):
     repo = create_git_repo(self)
     gitflow = GitFlow(repo).init()
     mgr = HotfixBranchManager(gitflow)
     self.assertEqual(0, len(mgr.list()))
     new_branch = mgr.create('1.2.3')
     self.assertEqual(1, len(mgr.list()))
     self.assertEqual('hotfix/1.2.3', mgr.list()[0].name)
     self.assertEqual(new_branch.commit,
             gitflow.repo.branches['master'].commit)
Exemplo n.º 6
0
 def test_hotfix_branch_origin(self):
     gitflow = GitFlow()
     mgr = HotfixBranchManager(gitflow)
     new_branch = mgr.create('3.14-beta5')
     self.assertEqual(new_branch.commit,
                      gitflow.repo.branches['stable'].commit)
Exemplo n.º 7
0
 def test_hotfix_branch_origin(self):
     gitflow = GitFlow()
     mgr = HotfixBranchManager(gitflow)
     new_branch = mgr.create('3.14-beta5')
     self.assertEqual(new_branch.commit,
             gitflow.repo.branches['stable'].commit)