From 31b3c1e39fa377e607a5f38ebeeb21bfc50811cc Mon Sep 17 00:00:00 2001 From: Elmir Jagudin Date: Sun, 3 Mar 2013 00:09:40 +0100 Subject: [PATCH] unit test on loading 'codebaseGenerator' master parameter Added unit tests on code in buildbot.config.MasterConfig.load_global() that loads 'codebaseGenerator' master configuration parameter. Test both loading correct parameter and invalid. --- master/buildbot/test/unit/test_config.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/master/buildbot/test/unit/test_config.py b/master/buildbot/test/unit/test_config.py index 10c2897390a..f295b6980bb 100644 --- a/master/buildbot/test/unit/test_config.py +++ b/master/buildbot/test/unit/test_config.py @@ -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)