def setUp(self): self.projectdir = tempfile.mkdtemp() self.temprepo = tempfile.mkdtemp() for i in range(2): base_dir = os.path.join(self.temprepo, 'project%d' % (i, )) testing.mkdir(base_dir) setup_py = '''from setuptools import setup setup(name='project%(num)d', version='1.0', py_modules=['test'])''' % {'num': i} with open(os.path.join(base_dir, 'setup.py'), 'w+') as fp: fp.write(setup_py) with open(os.path.join(base_dir, 'test.py'), 'w+') as fp: fp.write('# Dummy module') testing.system('cd %s && git init && git add * && git commit -m "Test"' % self.temprepo)
def setUp(self): self.tempdir = tempfile.mkdtemp() os.mkdir(os.path.join(self.tempdir, 'downloads')) self.tempcache = tempfile.mkdtemp() self.temprepos = tempfile.mkdtemp() self.repo_name = 'testrepo' self.temprepo = os.path.join(self.temprepos, self.repo_name) testing.mkdir(self.temprepo) os.chdir(self.tempdir) testing.system('cd %s && git init' % self.temprepo) testing.write(self.temprepo, 'test.txt', 'TEST') testing.system('cd %s && git add test.txt && git commit -m "Init"' % self.temprepo) testing.write(self.temprepo, 'test2.txt', 'TEST') testing.system('cd %s && git checkout -b test && git add test2.txt && git commit -m "Test-branch" && git checkout master' % self.temprepo)
def setUp(self): self.tempdir = tempfile.mkdtemp() os.mkdir(os.path.join(self.tempdir, 'downloads')) self.tempcache = tempfile.mkdtemp() self.temprepos = tempfile.mkdtemp() self.repo_name = 'testrepo' self.temprepo = os.path.join(self.temprepos, self.repo_name) testing.mkdir(self.temprepo) os.chdir(self.tempdir) testing.system('cd %s && git init' % self.temprepo) testing.write(self.temprepo, 'test.txt', 'TEST') testing.system('cd %s && git add test.txt && git commit -m "Init"' % self.temprepo) testing.write(self.temprepo, 'test2.txt', 'TEST') submodule_path = os.path.join(self.temprepo, 'submodule_repo') testing.system('mkdir -p %s && cd %s && git init && echo 1 > file && git add file && git commit -m file' % (submodule_path, submodule_path)) self.assertTrue(os.path.exists(os.path.join(submodule_path, '.git'))) testing.system('cd %s && git submodule add %s submodule && git add .gitmodules && git commit -m submodule' % (self.temprepo, submodule_path)) self.assertTrue(os.path.exists(os.path.join(self.temprepo, '.gitmodules'))) testing.system('cd %s && git checkout -b test && git add test2.txt && git commit -m "Test-branch" && git checkout master' % self.temprepo)
def setUp(self): self.location = os.getcwd() # Here we build a sample buildout self.tmp = tempfile.mkdtemp(prefix='sample-buildout') write(self.tmp, 'buildout.cfg', BUILDOUT_CFG) mkdir(self.tmp, 'sample_working_dir') mkdir(self.tmp, 'bugfix1') mkdir(self.tmp, 'bugfix1', 'bugfix1') write(self.tmp, 'bugfix1', 'bugfix1', '__init__.py', '') write(self.tmp, 'bugfix1', 'bugfix1', 'tests.py', TESTS_PY) write(self.tmp, 'bugfix1', 'setup.py', SETUP_PY) write(self.tmp, 'bugfix1', 'README.rst', '') os.chdir(self.tmp) zc.buildout.buildout.Buildout( 'buildout.cfg', [('buildout', 'log-level', 'WARNING')] ).init('fake-argument')