Repository: buildbot/buildbot

Issue:
Remove unused `DeferredPool`.
This was added 3 years ago ([here](https://github.com/buildbot/buildbot/pull/854)), but it was never used.



Discussion:

Resolving patch:
diff --git a/master/buildbot/steps/source/git.py b/master/buildbot/steps/source/git.py
--- a/master/buildbot/steps/source/git.py
+++ b/master/buildbot/steps/source/git.py
@@ -20,6 +20,39 @@
 from buildbot.steps.source.base import Source
 from buildbot.interfaces import BuildSlaveTooOldError
 
+def isTrueOrIsExactlyZero(v):
+    # nonzero values are true...
+    if v:
+        return True
+    
+    # ... and True for the number zero, but we have to
+    # explicitly guard against v==False, since
+    # isinstance(False, int) is surprisingly True
+    if isinstance(v, int) and v is not False:
+        return True
+    
+    # all other false-ish values are false
+    return False
+
+git_describe_flags = [
+    # on or off
+    ('all',         lambda v: ['--all'] if v else None),
+    ('always',      lambda v: ['--always'] if v else None),
+    ('contains',    lambda v: ['--contains'] if v else None),
+    ('debug',       lambda v: ['--debug'] if v else None),
+    ('long',        lambda v: ['--long'] if v else None),
+    ('exact-match', lambda v: ['--exact-match'] if v else None),
+    ('tags',        lambda v: ['--tags'] if v else None),
+    # string parameter
+    ('match',       lambda v: ['--match', v] if v else None),
+    # numeric parameter
+    ('abbrev',      lambda v: ['--abbrev=%s' % v] if isTrueOrIsExactlyZero(v) else None),
+    ('candidates',  lambda v: ['--candidates=%s' % v] if isTrueOrIsExactlyZero(v) else None),
+    # optional string parameter
+    ('dirty',       lambda v: ['--dirty'] if (v is True or v=='') else None),
+    ('dirty',       lambda v: ['--dirty=%s' % v] if (v and v is not True) else None),
+]
+
 class Git(Source):
     """ Class for Git with all the smarts """
     name='git'
@@ -27,7 +60,8 @@ class Git(Source):
 
     def __init__(self, repourl=None, branch='HEAD', mode='incremental',
                  method=None, submodules=False, shallow=False, progress=False,
-                 retryFetch=False, clobberOnFailure=False, **kwargs):
+                 retryFetch=False, clobberOnFailure=False, getDescription=False,
+                 **kwargs):
         """
         @type  repourl: string
         @param repourl: the URL which points at the git repository
@@ -57,7 +91,12 @@ def __init__(self, repourl=None, branch='HEAD', mode='incremental',
 
         @type  retryFetch: boolean
         @param retryFetch: Retry fetching before failing source checkout.
+        
+        @type  getDescription: boolean or dict
+        @param getDescription: Use 'git describe' to describe the fetched revision
         """
+        if not getDescription and not isinstance(getDescription, dict):
+            getDescription = False
 
         self.branch    = branch
         self.method    = method
@@ -69,6 +108,7 @@ def __init__(self, repourl=None, branch='HEAD', mode='incremental',
         self.fetchcount = 0
         self.clobberOnFailure = clobberOnFailure
         self.mode = mode
+        self.getDescription = getDescription
         Source.__init__(self, **kwargs)
         self.addFactoryArguments(branch=branch,
                                  mode=mode,
@@ -80,12 +120,15 @@ def __init__(self, repourl=None, branch='HEAD', mode='incremental',
                                  retryFetch=retryFetch,
                                  clobberOnFailure=
                                  clobberOnFailure,
+                                 getDescription=
+                                 getDescription
                                  )
 
         assert self.mode in ['incremental', 'full']
         assert self.repourl is not None
         if self.mode == 'full':
             assert self.method in ['clean', 'fresh', 'clobber', 'copy', None]
+        assert isinstance(self.getDescription, (bool, dict))
 
     def startVC(self, branch, revision, patch):
         self.branch = branch or 'HEAD'
@@ -107,6 +150,7 @@ def checkInstall(gitInstalled):
         if patch:
             d.addCallback(self.patch, patch)
         d.addCallback(self.parseGotRevision)
+        d.addCallback(self.parseCommitDescription)
         d.addCallback(self.finish)
         d.addErrback(self.failed)
         return d
@@ -224,17 +268,40 @@ def _gotResults(results):
         d.addCallbacks(self.finished, self.checkDisconnect)
         return d
 
-    def parseGotRevision(self, _):
-        d = self._dovccmd(['rev-parse', 'HEAD'], collectStdout=True)
-        def setrev(stdout):
-            revision = stdout.strip()
-            if len(revision) != 40:
-                raise buildstep.BuildStepFailed()
-            log.msg("Got Git revision %s" % (revision, ))
-            self.setProperty('got_revision', revision, 'Source')
-            return 0
-        d.addCallback(setrev)
-        return d
+    @defer.inlineCallbacks
+    def parseGotRevision(self, _=None):
+        stdout = yield self._dovccmd(['rev-parse', 'HEAD'], collectStdout=True)
+        revision = stdout.strip()
+        if len(revision) != 40:
+            raise buildstep.BuildStepFailed()
+        log.msg("Got Git revision %s" % (revision, ))
+        self.setProperty('got_revision', revision, 'Source')
+    
+        defer.returnValue(0)
+
+    @defer.inlineCallbacks
+    def parseCommitDescription(self, _=None):
+        if self.getDescription==False: # dict() should not return here
+            defer.returnValue(0)
+            return
+        
+        cmd = ['describe']
+        if isinstance(self.getDescription, dict):
+            for opt, arg in git_describe_flags:
+                opt = self.getDescription.get(opt, None)
+                arg = arg(opt)
+                if arg:
+                    cmd.extend(arg)            
+        cmd.append('HEAD')
+        
+        try:
+            stdout = yield self._dovccmd(cmd, collectStdout=True)
+            desc = stdout.strip()
+            self.setProperty('commit-description', desc, 'Source')
+        except:
+            pass
+            
+        defer.returnValue(0)
 
     def _dovccmd(self, command, abandonOnFailure=True, collectStdout=False, initialStdin=None):
         cmd = buildstep.RemoteShellCommand(self.workdir, ['git'] + command,


Test patch:
diff --git a/master/buildbot/test/unit/test_steps_source_git.py b/master/buildbot/test/unit/test_steps_source_git.py
--- a/master/buildbot/test/unit/test_steps_source_git.py
+++ b/master/buildbot/test/unit/test_steps_source_git.py
@@ -56,6 +56,7 @@ def test_mode_full_clean(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_clean_patch(self):
@@ -92,6 +93,7 @@ def test_mode_full_clean_patch(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_clean_patch_fail(self):
@@ -123,6 +125,7 @@ def test_mode_full_clean_patch_fail(self):
             + 1,
         )
         self.expectOutcome(result=FAILURE, status_text=["updating"])
+        self.expectNoProperty('got_revision')
         return self.runStep()
 
     def test_mode_full_clean_branch(self):
@@ -157,6 +160,7 @@ def test_mode_full_clean_branch(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_clean_parsefail(self):
@@ -186,6 +190,7 @@ def test_mode_full_clean_parsefail(self):
             + 128,
         )
         self.expectOutcome(result=FAILURE, status_text=["updating"])
+        self.expectNoProperty('got_revision')
         return self.runStep()
 
     def test_mode_full_clean_no_existing_repo(self):
@@ -265,6 +270,7 @@ def test_mode_full_clobber(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_clobber_branch(self):
@@ -292,6 +298,7 @@ def test_mode_full_clobber_branch(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_incremental(self):
@@ -321,6 +328,7 @@ def test_mode_incremental(self):
 
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_incremental_branch(self):
@@ -353,6 +361,7 @@ def test_mode_incremental_branch(self):
 
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_fresh(self):
@@ -384,6 +393,7 @@ def test_mode_full_fresh(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_incremental_given_revision(self):
@@ -412,6 +422,7 @@ def test_mode_incremental_given_revision(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_fresh_submodule(self):
@@ -450,6 +461,7 @@ def test_mode_full_fresh_submodule(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_clobber_shallow(self):
@@ -477,6 +489,7 @@ def test_mode_full_clobber_shallow(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_incremental_retryFetch(self):
@@ -514,6 +527,7 @@ def test_mode_incremental_retryFetch(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_incremental_retryFetch_branch(self):
@@ -554,6 +568,7 @@ def test_mode_incremental_retryFetch_branch(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_incremental_clobberOnFailure(self):
@@ -592,6 +607,7 @@ def test_mode_incremental_clobberOnFailure(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_incremental_clobberOnFailure_branch(self):
@@ -630,6 +646,7 @@ def test_mode_incremental_clobberOnFailure_branch(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_copy(self):
@@ -664,6 +681,7 @@ def test_mode_full_copy(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
 
@@ -691,6 +709,7 @@ def test_mode_incremental_no_existing_repo(self):
 
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_clobber_given_revision(self):
@@ -722,6 +741,7 @@ def test_mode_full_clobber_given_revision(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_revparse_failure(self):
@@ -753,6 +773,7 @@ def test_revparse_failure(self):
             + 0,
         )
         self.expectOutcome(result=FAILURE, status_text=["updating"])
+        self.expectNoProperty('got_revision')
         return self.runStep()
 
     def test_mode_full_clobber_submodule(self):
@@ -783,6 +804,7 @@ def test_mode_full_clobber_submodule(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_repourl(self):
@@ -818,6 +840,7 @@ def test_mode_full_fresh_revision(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_fresh_clobberOnFailure(self):
@@ -853,6 +876,7 @@ def test_mode_full_fresh_clobberOnFailure(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_no_method(self):
@@ -884,6 +908,7 @@ def test_mode_full_no_method(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_with_env(self):
@@ -920,6 +945,7 @@ def test_mode_full_with_env(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
         return self.runStep()
 
     def test_mode_full_logEnviron(self):
@@ -956,4 +982,337 @@ def test_mode_full_logEnviron(self):
             + 0,
         )
         self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
+        return self.runStep()
+
+    def test_getDescription(self):
+        # clone of: test_mode_incremental
+        # only difference is to set the getDescription property
+
+        self.setupStep(
+                git.Git(repourl='http://github.com/buildbot/buildbot.git',
+                                    mode='incremental',
+                                    getDescription=True))
+        self.expectCommands(
+            ## copied from test_mode_incremental:
+            ExpectShell(workdir='wkdir',
+                        command=['git', '--version'])
+            + 0,
+            Expect('stat', dict(file='wkdir/.git',
+                                logEnviron=True))
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'fetch', '-t',
+                                 'http://github.com/buildbot/buildbot.git',
+                                 'HEAD'])
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'reset', '--hard', 'FETCH_HEAD'])
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'rev-parse', 'HEAD'])
+            + ExpectShell.log('stdio',
+                stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
+            + 0,
+            
+            ## plus this to test describe:            
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'describe', 'HEAD'])
+            + ExpectShell.log('stdio',
+                stdout='Tag-1234')
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
+        self.expectProperty('commit-description', 'Tag-1234', 'Source')
+        return self.runStep()
+
+    def test_getDescription_failed(self):
+        # clone of: test_mode_incremental
+        # only difference is to set the getDescription property
+
+        # this tests when 'git describe' fails; for example, there are no
+        # tags in the repository
+        
+        self.setupStep(
+                git.Git(repourl='http://github.com/buildbot/buildbot.git',
+                                    mode='incremental',
+                                    getDescription=True))
+        self.expectCommands(
+            ## copied from test_mode_incremental:
+            ExpectShell(workdir='wkdir',
+                        command=['git', '--version'])
+            + 0,
+            Expect('stat', dict(file='wkdir/.git',
+                                logEnviron=True))
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'fetch', '-t',
+                                 'http://github.com/buildbot/buildbot.git',
+                                 'HEAD'])
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'reset', '--hard', 'FETCH_HEAD'])
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'rev-parse', 'HEAD'])
+            + ExpectShell.log('stdio',
+                stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
+            + 0,
+            
+            ## plus this to test describe:            
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'describe', 'HEAD'])
+            + ExpectShell.log('stdio',
+                stdout='')
+            + 128, # error, but it's suppressed
+        )
+        self.expectOutcome(result=SUCCESS, status_text=["update"])
+        self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
+        self.expectNoProperty('commit-description')
+        return self.runStep()
+
+    def setup_getDescription_test(self, setup_args, output_args, codebase=None):
+        # clone of: test_mode_full_clobber
+        # only difference is to set the getDescription property
+
+        kwargs = {}
+        if codebase is not None:
+            kwargs.update(codebase=codebase)
+
+        self.setupStep(
+                git.Git(repourl='http://github.com/buildbot/buildbot.git',
+                        mode='full', method='clobber', progress=True,
+                        getDescription=setup_args,
+                        **kwargs))
+
+        self.expectCommands(
+            ## copied from test_mode_full_clobber:
+            ExpectShell(workdir='wkdir',
+                        command=['git', '--version'])
+            + 0,
+            Expect('rmdir', dict(dir='wkdir',
+                                 logEnviron=True))
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'clone',
+                                 '--branch', 'HEAD',
+                                 'http://github.com/buildbot/buildbot.git',
+                                 '.', '--progress'])
+            + 0,
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'rev-parse', 'HEAD'])
+            + ExpectShell.log('stdio',
+                stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
+            + 0,
+            
+            ## plus this to test describe:            
+            ExpectShell(workdir='wkdir',
+                        command=['git', 'describe'] +
+                                output_args +
+                                ['HEAD'])
+            + ExpectShell.log('stdio',
+                stdout='Tag-1234')
+            + 0,
+        )
+        
+        if codebase:
+            self.expectOutcome(result=SUCCESS, status_text=["update", codebase])
+            self.expectProperty('got_revision', {codebase:'f6ad368298bd941e934a41f3babc827b2aa95a1d'}, 'Source')
+            self.expectProperty('commit-description', {codebase:'Tag-1234'}, 'Source')
+        else:
+            self.expectOutcome(result=SUCCESS, status_text=["update"])
+            self.expectProperty('got_revision', 'f6ad368298bd941e934a41f3babc827b2aa95a1d', 'Source')
+            self.expectProperty('commit-description', 'Tag-1234', 'Source')
+
+    def test_getDescription_empty_dict(self):
+        self.setup_getDescription_test(
+            setup_args = {},
+            output_args = []
+        )
+        return self.runStep()
+
+    def test_getDescription_empty_dict_with_codebase(self):
+        self.setup_getDescription_test(
+            setup_args = {},
+            output_args = [],
+            codebase = 'baz'
+        )
+        return self.runStep()
+
+    def test_getDescription_match(self):
+        self.setup_getDescription_test(
+            setup_args = { 'match': 'stuff-*' },
+            output_args = ['--match', 'stuff-*']
+        )
+        return self.runStep()
+    def test_getDescription_match_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'match': None },
+            output_args = []
+        )
+        return self.runStep()
+        
+    def test_getDescription_tags(self):
+        self.setup_getDescription_test(
+            setup_args = { 'tags': True },
+            output_args = ['--tags']
+        )
+        return self.runStep()
+    def test_getDescription_tags_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'tags': False },
+            output_args = []
+        )
+        return self.runStep()
+        
+    def test_getDescription_all(self):
+        self.setup_getDescription_test(
+            setup_args = { 'all': True },
+            output_args = ['--all']
+        )
+        return self.runStep()
+    def test_getDescription_all_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'all': False },
+            output_args = []
+        )
+        return self.runStep()
+        
+    def test_getDescription_abbrev(self):
+        self.setup_getDescription_test(
+            setup_args = { 'abbrev': 7 },
+            output_args = ['--abbrev=7']
+        )
+        return self.runStep()
+    def test_getDescription_abbrev_zero(self):
+        self.setup_getDescription_test(
+            setup_args = { 'abbrev': 0 },
+            output_args = ['--abbrev=0']
+        )
+        return self.runStep()
+    def test_getDescription_abbrev_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'abbrev': False },
+            output_args = []
+        )
+        return self.runStep()
+        
+    def test_getDescription_dirty(self):
+        self.setup_getDescription_test(
+            setup_args = { 'dirty': True },
+            output_args = ['--dirty']
+        )
+        return self.runStep()
+    def test_getDescription_dirty_empty_str(self):
+        self.setup_getDescription_test(
+            setup_args = { 'dirty': '' },
+            output_args = ['--dirty']
+        )
+        return self.runStep()
+    def test_getDescription_dirty_str(self):
+        self.setup_getDescription_test(
+            setup_args = { 'dirty': 'foo' },
+            output_args = ['--dirty=foo']
+        )
+        return self.runStep()
+    def test_getDescription_dirty_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'dirty': False },
+            output_args = []
+        )
+        return self.runStep()
+        
+    def test_getDescription_contains(self):
+        self.setup_getDescription_test(
+            setup_args = { 'contains': True },
+            output_args = ['--contains']
+        )
+        return self.runStep()
+    def test_getDescription_contains_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'contains': False },
+            output_args = []
+        )
+        return self.runStep()
+        
+    def test_getDescription_candidates(self):
+        self.setup_getDescription_test(
+            setup_args = { 'candidates': 7 },
+            output_args = ['--candidates=7']
+        )
+        return self.runStep()
+    def test_getDescription_candidates_zero(self):
+        self.setup_getDescription_test(
+            setup_args = { 'candidates': 0 },
+            output_args = ['--candidates=0']
+        )
+        return self.runStep()
+    def test_getDescription_candidates_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'candidates': False },
+            output_args = []
+        )
+        return self.runStep()
+
+    def test_getDescription_exact_match(self):
+        self.setup_getDescription_test(
+            setup_args = { 'exact-match': True },
+            output_args = ['--exact-match']
+        )
+        return self.runStep()
+    def test_getDescription_exact_match_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'exact-match': False },
+            output_args = []
+        )
+        return self.runStep()
+
+    def test_getDescription_debug(self):
+        self.setup_getDescription_test(
+            setup_args = { 'debug': True },
+            output_args = ['--debug']
+        )
+        return self.runStep()
+    def test_getDescription_debug_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'debug': False },
+            output_args = []
+        )
+        return self.runStep()
+
+    def test_getDescription_long(self):
+        self.setup_getDescription_test(
+            setup_args = { 'long': True },
+            output_args = ['--long']
+        )
+    def test_getDescription_long_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'long': False },
+            output_args = []
+        )
+        return self.runStep()
+
+    def test_getDescription_always(self):
+        self.setup_getDescription_test(
+            setup_args = { 'always': True },
+            output_args = ['--always']
+        )
+    def test_getDescription_always_false(self):
+        self.setup_getDescription_test(
+            setup_args = { 'always': False },
+            output_args = []
+        )
+        return self.runStep()
+
+    def test_getDescription_lotsa_stuff(self):
+        self.setup_getDescription_test(
+            setup_args = { 'match': 'stuff-*',
+                           'abbrev': 6,
+                           'exact-match': True},
+            output_args = ['--exact-match',
+                           '--match', 'stuff-*',
+                           '--abbrev=6'],
+            codebase='baz'
+        )
         return self.runStep()