def test_checkout(self):
        new_branch = 'iamanothernewbranch'
        self.assertEqual(
            self.run_function(
                'git.checkout',
                [self.repo, 'HEAD'],
                opts='-b ' + new_branch
            ),
            'Switched to a new branch \'' + new_branch + '\''
        )
        self.assertTrue(
            'Switched to branch \'master\'' in
            self.run_function('git.checkout', [self.repo, 'master']),
        )
Test checking out a new branch and then checking out master again
dataset/ETHPy150Open saltstack/salt/tests/integration/modules/git.py/GitModuleTest.test_checkout