@patch.object(lib, 'call')
    def test_update_different_branches(self, call_mock):
        """ The git formula should call checkout if target branch is not the current branch """
        install_directory = self.directory.install_directory('update')
        os.makedirs(install_directory)
        call_count = 0
        return_values = {
            CURRENT_REMOTE.format(dir=install_directory):
                'git://github.com/toumorokoshi/sprinter.git',
            CURRENT_BRANCH.format(dir=install_directory):
                'master'
        }
        call_mock.side_effect = lambda cmd, **kw: (0, return_values[cmd] if cmd in return_values else '')
        self.environment.run_feature('update', 'sync')
        call_mock.assert_any_call(
            FETCH_BRANCH.format(dir=install_directory, branch='develop'),
            output_log_level=logging.DEBUG
        )
        call_mock.assert_any_call(
            CHECKOUT_BRANCH.format(dir=install_directory, branch='develop'),
            output_log_level=logging.DEBUG
        )
dataset/ETHPy150Open toumorokoshi/sprinter/sprinter/formula/tests/test_git.py/TestGitFormula.test_update_different_branches/original