def setUp(self):
        super(BaseGitRestackTestCase, self).setUp()
        self.useFixture(fixtures.Timeout(2 * 60, True))

        self.root_dir = self.useFixture(fixtures.TempDir()).path
        self.upstream_dir = os.path.join(self.root_dir, "upstream")
        self.local_dir = os.path.join(self.root_dir, "local")

        os.makedirs(self._dir('upstream'))
        self._run_git('upstream', 'init')
        self._simple_change('upstream', 'initial text', 'initial commit')
        self._simple_change('upstream', 'second text', 'second commit')
        self._run_git('upstream', 'checkout', '-b', 'branch1')
        self._simple_change('upstream', 'branch1 text', 'branch1 commit')
        self._run_git('upstream', 'checkout', 'master')
        self._run_git('upstream', 'checkout', '-b', 'branch2')

        gitreview = '[gerrit]\ndefaultbranch=branch2\n'
        self._simple_change('upstream', gitreview, 'branch2 commit',
                            file_=self._dir('upstream', '.gitreview'))
        self._run_git('upstream', 'checkout', 'master')
Configure testing environment.
dataset/ETHPy150Open openstack-infra/git-restack/git_restack/tests/__init__.py/BaseGitRestackTestCase.setUp