def test_current_branch(self): contents = [{'A': '1'}] commits = self.create_repo(contents) self.assertEqual('master', subject.current_branch(self.scratch)) subject.git_op(['checkout', '-b', 'newbranch'], self.scratch) branch_contents = [{'B': '1'}] branch_commits = self.create_commits(branch_contents) self.assertEqual('newbranch', subject.current_branch(self.scratch))
def test_checkout(self): contents = [{'A': '1'}] commits = self.create_repo(contents) subject.checkout(self.scratch, 'master') self.assertEqual('master', subject.current_branch(self.scratch)) subject.checkout(self.scratch, branch_name='newbranch2') self.assertEqual('newbranch2', subject.current_branch(self.scratch)) subject.checkout(self.scratch, 'master') self.assertEqual('master', subject.current_branch(self.scratch))