Ejemplo n.º 1
0
    def test_checkout_same_ref(self):
        git = GitCmd()
        git.do_branch('newbranch')

        command = [G.GIT, '-C', G.repodir, 'checkout', 'newbranch']
        process = cw.run_process(command)

        git.do_checkout('newbranch')
        git.do_listbranches('')
        expected = "  data\n* newbranch\n"
        actual = git.output

        command = [G.GIT, '-C', G.repodir, 'checkout', G.current_branch]
        process = cw.run_process(command)
        command = [G.GIT, '-C', G.repodir, 'branch', '-d', 'newbranch']
        process = cw.run_process(command)

        self.assertEqual(actual, expected)
Ejemplo n.º 2
0
    def test_listbranches(self):
        git = GitCmd()
        git.do_listbranches('')

        expected = "* data\n"
        self.assertEqual(git.output, expected)