Ejemplo n.º 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)
Ejemplo n.º 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())
Ejemplo n.º 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)
Ejemplo n.º 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())
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 7
0
 def test_branch_names_fails_in_new_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.branch_names)
Ejemplo n.º 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')
Ejemplo n.º 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')
Ejemplo n.º 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())
Ejemplo n.º 11
0
 def test_new_repo_is_not_dirty(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertFalse(gitflow.is_dirty())
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 14
0
 def test_branch_names_fails_in_new_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.branch_names)
Ejemplo n.º 15
0
 def test_new_repo_is_not_dirty(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox).init()
     self.assertFalse(gitflow.is_dirty())
Ejemplo n.º 16
0
 def test_gitflow_cannot_get_status_on_empty_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.status)
Ejemplo n.º 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())
Ejemplo n.º 18
0
 def test_gitflow_cannot_get_status_on_empty_sandbox(self):
     sandbox = create_sandbox(self)
     gitflow = GitFlow(sandbox)
     self.assertRaises(NotInitialized, gitflow.status)