Skip to content

Commit

Permalink
unit test on loading 'codebaseGenerator' master parameter
Browse files Browse the repository at this point in the history
Added unit tests on code in buildbot.config.MasterConfig.load_global()
that loads 'codebaseGenerator' master configuration parameter. Test
both loading correct parameter and invalid.
  • Loading branch information
Elmir Jagudin committed Mar 5, 2013
1 parent 7cc5491 commit 31b3c1e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions master/buildbot/test/unit/test_config.py
Expand Up @@ -410,6 +410,18 @@ def test_load_global_logCompressionMethod_invalid(self):
dict(logCompressionMethod='foo'))
self.assertConfigError(self.errors, "must be 'bz2' or 'gz'")

def test_load_global_codebaseGenerator(self):
func = lambda _: "dummy"
self.do_test_load_global(dict(codebaseGenerator=func),
codebaseGenerator=func)

def test_load_global_codebaseGenerator_invalid(self):
self.cfg.load_global(self.filename,
dict(codebaseGenerator='dummy'))
self.assertConfigError(self.errors,
"codebaseGenerator must be a callable "
"accepting a dict and returning a str")

def test_load_global_logMaxSize(self):
self.do_test_load_global(dict(logMaxSize=123), logMaxSize=123)

Expand Down

0 comments on commit 31b3c1e

Please sign in to comment.