Skip to content

Commit

Permalink
add a basedir_source convenience variable to CommandTestMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin J. Mitchell committed Aug 1, 2010
1 parent c9d8d8f commit f389036
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions slave/buildslave/test/unit/test_commands_arch.py
Expand Up @@ -48,7 +48,7 @@ def test_simple(self):
+ { 'stdout' : '9753\n' }
+ 0,
Expect(['path/to/tla', 'logs', '--full', '--reverse'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
timeout=120, sendRC=False, usePTY=False, keepStdout=True,
sendStdout=False, sendStderr=False, environ=exp_environ)
+ { 'stdout' : 'funarchive/mainline--patch-22\n' }
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_simple(self):
+ { 'stdout' : '9753\n' }
+ 0,
Expect(['path/to/baz', 'tree-id'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
timeout=120, sendRC=False, usePTY=False, keepStdout=True,
sendStdout=False, sendStderr=False, environ=exp_environ)
+ { 'stdout' : 'funarchive/mainline--patch-22\n' }
Expand Down
2 changes: 1 addition & 1 deletion slave/buildslave/test/unit/test_commands_bk.py
Expand Up @@ -39,7 +39,7 @@ def test_simple(self):
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect(['path/to/bk', 'changes', '-r+', '-d:REV:'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, usePTY=False, timeout=120, sendStderr=False,
sendStdout=False, keepStdout=True, environ=exp_environ)
+ { 'stdout' : '1.114\n' } # TODO: is this what BK outputs?
Expand Down
2 changes: 1 addition & 1 deletion slave/buildslave/test/unit/test_commands_bzr.py
Expand Up @@ -47,7 +47,7 @@ def test_simple(self):
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect(['path/to/bzr', 'version-info'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, usePTY=False, keepStdout=True,
environ=exp_environ, sendStderr=False, sendStdout=False)
+ { 'stdout' : verinfo }
Expand Down
2 changes: 1 addition & 1 deletion slave/buildslave/test/unit/test_commands_darcs.py
Expand Up @@ -39,7 +39,7 @@ def test_simple(self):
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect([ 'path/to/darcs', 'changes', '--context' ],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False, keepStdout=True,
environ=exp_environ, sendStderr=False, sendStdout=False)
+ { 'stdout' : example_changes }
Expand Down
12 changes: 6 additions & 6 deletions slave/buildslave/test/unit/test_commands_git.py
Expand Up @@ -35,28 +35,28 @@ def test_simple(self):
+ 0,
# TODO: capture makedirs invocation here
Expect([ 'path/to/git', 'init'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect([ 'path/to/git', 'clean', '-f', '-d', '-x'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect([ 'path/to/git', 'fetch', '-t',
'git://github.com/djmitche/buildbot.git', '+master' ],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect(['path/to/git', 'reset', '--hard', 'FETCH_HEAD'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect(['path/to/git', 'branch', '-M', 'master'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect([ 'path/to/git', 'rev-parse', 'HEAD' ],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False, keepStdout=True)
+ { 'stdout' : '4026d33b0532b11f36b0875f63699adfa8ee8662\n' }
+ 0,
Expand Down
6 changes: 3 additions & 3 deletions slave/buildslave/test/unit/test_commands_hg.py
Expand Up @@ -39,13 +39,13 @@ def test_simple(self):
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect(['path/to/hg', 'identify', '--num', '--branch'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False, keepStdout=True,
keepStderr=True)
+ { 'stdout' : '-1 default\n' }
+ 0,
Expect(['path/to/hg', 'paths', 'default'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False, keepStdout=True,
keepStderr=True)
+ { 'stdout' : 'http://bitbucket.org/nicolas17/pyboinc\n' }
Expand All @@ -56,7 +56,7 @@ def test_simple(self):
sendRC=False, timeout=120, usePTY=False)
+ 0,
Expect(['path/to/hg', 'identify', '--id', '--debug'],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False, environ=exp_environ,
keepStdout=True)
+ { 'stdout' : 'b7ddc0b638fa11cdac7c0345c40c6f76d8a7166d' }
Expand Down
2 changes: 1 addition & 1 deletion slave/buildslave/test/unit/test_commands_svn.py
Expand Up @@ -40,7 +40,7 @@ def test_simple(self):
sendRC=False, timeout=120, usePTY=False, environ=exp_environ)
+ 0,
Expect([ 'path/to/svnversion', '.' ],
os.path.join(self.basedir, 'source'),
self.basedir_source,
sendRC=False, timeout=120, usePTY=False, keepStdout=True,
environ=exp_environ, sendStderr=False, sendStdout=False)
+ { 'stdout' : '9753\n' }
Expand Down
2 changes: 2 additions & 0 deletions slave/buildslave/test/util/command.py
Expand Up @@ -17,9 +17,11 @@ def setUpCommand(self):
Sets:
self.basedir -- the basedir (an abs path)
self.basedir_workdir -- os.path.join(self.basedir, 'workdir')
self.basedir_source -- os.path.join(self.basedir, 'source')
"""
self.basedir = os.path.abspath('basedir')
self.basedir_workdir = os.path.join(self.basedir, 'workdir')
self.basedir_source = os.path.join(self.basedir, 'source')

def tearDownCommand(self):
"""
Expand Down

0 comments on commit f389036

Please sign in to comment.