def setUp(self): JailSetup.setUp(self) # monkeypatch GIT_CACHE to point to a temporary directory config.GIT_CACHE = join(self.tempdir, '.gitcache/') # copy the test repo to temp, we perform all checkouts from there: try: # the target folder needs to be the packagename, so that the # file:/// urls used throughout testing match the pacakge name # normally, the filesystem name doesn't matter, when it's being # served via http os.mkdir(join(self.tempdir, "repos")) self.repo = join(self.tempdir, 'repos', self.packagename) subprocess.check_call(["svnadmin", "create", self.repo]) subprocess.check_call( ["svn", "mkdir", "-m", "repo layout"] +["file://%s/%s" % (self.repo, folder) for folder in ('trunk', 'branches', 'tags')], stdout=subprocess.PIPE) self.checkout(target="setUp") open('README.txt', 'w').write("Package documentation\n") subprocess.check_call(["svn", "add", "README.txt"], stdout=subprocess.PIPE) subprocess.check_call(["svn", "commit", "-m", "Begin docs"], stdout=subprocess.PIPE) open('foo.py', 'w').write('"""fooberizing"""\n') subprocess.check_call(["svn", "add", "foo.py"], stdout=subprocess.PIPE) subprocess.check_call( ["svn", "commit", "-m", "First attempt at fooberizing"], stdout=subprocess.PIPE) subprocess.check_call(["svn", "copy", "-m", "Release 0.1", "file://%s/trunk" % self.repo, "file://%s/tags/0.1" % self.repo], stdout=subprocess.PIPE) subprocess.check_call( ["svn", "copy", "-m", "Begin work on feature bar", "file://%s/trunk" % self.repo, "file://%s/branches/feature-bar" % self.repo], stdout=subprocess.PIPE) subprocess.check_call( ["svn", "switch", "file://%s/branches/feature-bar" % self.repo], stdout=subprocess.PIPE) open('README.txt', 'a').write("Now supports bar\n") open('foo.py', 'a').write('import bar\n') open('bar.py', 'w').write('"""barberizing"""\n') subprocess.check_call(["svn", "add", "bar.py"], stdout=subprocess.PIPE) subprocess.check_call( ["svn", "commit", "-m", "Implement bar feature"], stdout=subprocess.PIPE) except: self.cleanUp() raise
def setUp(self): JailSetup.setUp(self) try: self.packagedir = join(self.tempdir, 'testpackage') os.mkdir(self.packagedir) os.chdir(self.packagedir) subprocess.check_call(['git', 'init'], stdout=subprocess.PIPE) except: self.cleanUp() raise
def setUp(self): JailSetup.setUp(self) try: package = join(dirname(__file__), 'tests', self.source) self.packagedir = join(self.tempdir, 'testpackage') shutil.copytree(package, self.packagedir) os.chdir(self.packagedir) except: self.cleanUp() raise
def setUp(self): JailSetup.setUp(self) # monkeypatch GIT_CACHE to point to a temporary directory config.GIT_CACHE = join(self.tempdir, '.gitcache/') # copy the test repo to temp, we perform all checkouts from there: try: original_repo = join(dirname(__file__), 'tests', self.source) # the target folder needs to be the packagename, so that the # file:/// urls used throughout testing match the pacakge name # normally, the filesystem name doesn't matter, when it's being # served via http os.mkdir("%s/repos/" % self.tempdir) self.repo = join(self.tempdir, 'repos', self.packagename) shutil.copytree(original_repo, self.repo) except: self.cleanUp() raise
def setUp(self): JailSetup.setUp(self) # monkeypatch GIT_CACHE to point to a temporary directory config.GIT_CACHE = join(self.tempdir, '.gitcache/') # copy the test repo to temp, we perform all checkouts from there: try: # the target folder needs to be the packagename, so that the # file:/// urls used throughout testing match the pacakge name # normally, the filesystem name doesn't matter, when it's being # served via http os.mkdir(join(self.tempdir, "repos")) self.repo = join(self.tempdir, 'repos', self.packagename) subprocess.check_call(["svnadmin", "create", self.repo]) subprocess.check_call(["svn", "mkdir", "-m", "repo layout"] + [ "file://%s/%s" % (self.repo, folder) for folder in ('trunk', 'branches', 'tags') ], stdout=subprocess.PIPE) self.checkout(target="setUp") open('README.txt', 'w').write("Package documentation\n") subprocess.check_call(["svn", "add", "README.txt"], stdout=subprocess.PIPE) subprocess.check_call(["svn", "commit", "-m", "Begin docs"], stdout=subprocess.PIPE) open('foo.py', 'w').write('"""fooberizing"""\n') subprocess.check_call(["svn", "add", "foo.py"], stdout=subprocess.PIPE) subprocess.check_call( ["svn", "commit", "-m", "First attempt at fooberizing"], stdout=subprocess.PIPE) subprocess.check_call([ "svn", "copy", "-m", "Release 0.1", "file://%s/trunk" % self.repo, "file://%s/tags/0.1" % self.repo ], stdout=subprocess.PIPE) subprocess.check_call([ "svn", "copy", "-m", "Begin work on feature bar", "file://%s/trunk" % self.repo, "file://%s/branches/feature-bar" % self.repo ], stdout=subprocess.PIPE) subprocess.check_call([ "svn", "switch", "file://%s/branches/feature-bar" % self.repo ], stdout=subprocess.PIPE) open('README.txt', 'a').write("Now supports bar\n") open('foo.py', 'a').write('import bar\n') open('bar.py', 'w').write('"""barberizing"""\n') subprocess.check_call(["svn", "add", "bar.py"], stdout=subprocess.PIPE) subprocess.check_call( ["svn", "commit", "-m", "Implement bar feature"], stdout=subprocess.PIPE) except: self.cleanUp() raise
def setUp(self): JailSetup.setUp(self) # Create some dirs os.mkdir('foo') os.mkdir(join('foo', 'bar'))