Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added check for ints for caches and added a test.

  • Loading branch information...
commit 5b22df96df9056ba01a47b27f2c889af48d9a623 1 parent bee6af8
@ewongbb ewongbb authored
View
9 master/buildbot/config.py
@@ -361,10 +361,11 @@ def load_caches(self, filename, config_dict, errors):
if not isinstance(caches, dict):
errors.addError("c['caches'] must be a dictionary")
else:
- vals = caches.values()
- for x in vals:
- if (not isinstance(x, int)):
- errors.addError("value must be an int")
+ valPairs = caches.items()
+ for (x, y) in valPairs:
+ if (not isinstance(y, int)):
+ errors.addError(
+ "value for cache size '%s' must be an integer" % x)
self.caches.update(caches)
if 'buildCacheSize' in config_dict:
View
3  master/buildbot/test/unit/test_config.py
@@ -550,7 +550,8 @@ def test_load_caches_entries_test(self):
self.cfg.load_caches(self.filename,
dict(caches=dict(foo="1")),
self.errors)
- self.assertConfigError(self.errors, "must be an int")
+ self.assertConfigError(self.errors,
+ "value for cache size 'foo' must be an integer")
def test_load_schedulers_defaults(self):
self.cfg.load_schedulers(self.filename, {}, self.errors)
Please sign in to comment.
Something went wrong with that request. Please try again.