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.projectdir = tempfile.mkdtemp() self.temprepo = tempfile.mkdtemp() os.chdir(self.projectdir) 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 runTest(self): output = system(os.path.join(self.tmp, 'bin', 'test') + ' -vv -j2') comp_lines = OUTPUT_COMP.split('\n') # Here we check if meaningful outputs have been given. See above. self.assertTrue(OUTPUT_COMP) self.assertTrue(comp_lines) for line in comp_lines: self.assertIn(line, output)
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 install_projects(projects, target_dir): links = [] for project in projects: project_dir = os.path.join(projects_dir, project) dist_dir = os.path.join(project_dir, 'dist') if os.path.isdir(dist_dir): testing.rmdir(dist_dir) dummy = testing.system("%s setup %s bdist_egg" % ( os.path.join('bin', 'buildout'), project_dir)) links.append(dist_dir) new_working_set = install(projects, target_dir, links=links, working_set=working_set) # we must perform a magical incantation on each distribution for dist in new_working_set: dist.activate() return new_working_set
def install_projects(projects, target_dir): links = [] for project in projects: project_dir = os.path.join(projects_dir, project) dist_dir = os.path.join(project_dir, 'dist') if os.path.isdir(dist_dir): testing.rmdir(dist_dir) dummy = testing.system("%s setup %s bdist_egg" % (os.path.join('bin', 'buildout'), project_dir)) links.append(dist_dir) new_working_set = install(projects, target_dir, links=links, working_set=working_set) # we must perform a magical incantation on each distribution for dist in new_working_set: dist.activate() return new_working_set
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)