Example #1
0
 def test_finish_in_new_sandbox_without_commit(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     gitflow.create('feature', 'wow-feature', base=None, fetch=False)
     gitflow.finish('feature', 'wow-feature', False, False, False, False,
                    None)
     self.assertNotIn('feature/wow-feature', gitflow.repo.branches)
Example #2
0
 def test_gitflow_init_inits_underlying_git_repo(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     dot_git_dir = os.path.join(sandbox, '.git')
     self.assertFalse(os.path.exists(dot_git_dir))
     gitflow.init()
     self.assertTrue(os.path.exists(dot_git_dir))
     self.assertTrue(gitflow.is_initialized())
Example #3
0
 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)
Example #4
0
 def test_gitflow_init_inits_underlying_git_repo(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     dot_git_dir = os.path.join(sandbox, '.git')
     self.assertFalse(os.path.exists(dot_git_dir))
     gitflow.init()
     self.assertTrue(os.path.exists(dot_git_dir))
     self.assertTrue(gitflow.is_initialized())
Example #5
0
 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)
Example #6
0
 def test_create_in_new_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     gitflow.create('feature', 'wow-feature', base=None, fetch=False)
     self.assertIn('feature/wow-feature', gitflow.repo.branches)
Example #7
0
 def test_branch_names_fails_in_new_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.branch_names)
Example #8
0
 def test_gitflow_required_remote_raises_error_on_nonexisting_remote(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertRaises(NoSuchRemoteError, gitflow.require_remote,
                       'some-remote')
Example #9
0
 def test_gitflow_required_remote_raises_error_on_nonexisting_remote(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertRaises(NoSuchRemoteError,
                       gitflow.require_remote, 'some-remote')
Example #10
0
 def test_new_repo_has_no_staged_commits(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertFalse(gitflow.has_staged_commits())
Example #11
0
 def test_new_repo_is_not_dirty(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertFalse(gitflow.is_dirty())
Example #12
0
 def test_finish_in_new_sandbox_without_commit(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     gitflow.create('feature', 'wow-feature', base=None, fetch=False)
     gitflow.finish('feature', 'wow-feature', False, False, False, False, None)
     self.assertNotIn('feature/wow-feature', gitflow.repo.branches)
Example #13
0
 def test_create_in_new_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     gitflow.create('feature', 'wow-feature', base=None, fetch=False)
     self.assertIn('feature/wow-feature', gitflow.repo.branches)
Example #14
0
 def test_branch_names_fails_in_new_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.branch_names)
Example #15
0
 def test_new_repo_is_not_dirty(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertFalse(gitflow.is_dirty())
Example #16
0
 def test_gitflow_cannot_get_status_on_empty_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.status)
Example #17
0
 def test_new_repo_has_no_staged_commits(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertFalse(gitflow.has_staged_commits())
Example #18
0
 def test_gitflow_cannot_get_status_on_empty_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.status)