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)
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())
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)
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)
def test_branch_names_fails_in_new_sandbox(self): sandbox = create_sandbox(self) gitflow = GitFlow(sandbox) self.assertRaises(NotInitialized, gitflow.branch_names)
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')
def test_new_repo_has_no_staged_commits(self): sandbox = create_sandbox(self) gitflow = GitFlow(sandbox).init() self.assertFalse(gitflow.has_staged_commits())
def test_new_repo_is_not_dirty(self): sandbox = create_sandbox(self) gitflow = GitFlow(sandbox).init() self.assertFalse(gitflow.is_dirty())
def test_gitflow_cannot_get_status_on_empty_sandbox(self): sandbox = create_sandbox(self) gitflow = GitFlow(sandbox) self.assertRaises(NotInitialized, gitflow.status)