summaryrefslogtreecommitdiff
path: root/cbuildbot/cbuildbot_config_unittest.py
diff options
context:
space:
mode:
authorAviv Keshet <akeshet@chromium.org>2014-11-19 17:02:22 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-26 20:55:57 +0000
commit80f5ef18e54ca6cd918a5d4ba8dc3fbe79a8c5f6 (patch)
tree85a69cd5d714ebb13ef97ec0bcb0065aaff7641f /cbuildbot/cbuildbot_config_unittest.py
parenta9e615f9c73a851914fcbf906e6595539b486e00 (diff)
downloadchromite-80f5ef18e54ca6cd918a5d4ba8dc3fbe79a8c5f6.tar.gz
cbuildbot_config: add a delete_key/delete_keys feature
BUG=chromium:433459 TEST=New unit test. Inspection of config dump diff. Change-Id: Ia557a778a13c906d92033d045d73bdd2c32194f1 Reviewed-on: https://chromium-review.googlesource.com/231123 Reviewed-by: Yu-Ju Hong <yjhong@chromium.org> Commit-Queue: Aviv Keshet <akeshet@chromium.org> Tested-by: Aviv Keshet <akeshet@chromium.org>
Diffstat (limited to 'cbuildbot/cbuildbot_config_unittest.py')
-rwxr-xr-xcbuildbot/cbuildbot_config_unittest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/cbuildbot/cbuildbot_config_unittest.py b/cbuildbot/cbuildbot_config_unittest.py
index b93fe623e..88d81c14e 100755
--- a/cbuildbot/cbuildbot_config_unittest.py
+++ b/cbuildbot/cbuildbot_config_unittest.py
@@ -65,6 +65,20 @@ class ConfigClassTest(cros_test_lib.TestCase):
self.assertRaises(AttributeError, getattr, cfg, 'foobar')
+ # pylint: disable-msg=W0212
+ def testDeleteKey(self):
+ base_config = cbuildbot_config._config(foo='bar')
+ inherited_config = base_config.derive(foo=cbuildbot_config.delete_key())
+ self.assertTrue('foo' in base_config)
+ self.assertFalse('foo' in inherited_config)
+
+ def testDeleteKeys(self):
+ base_config = cbuildbot_config._config(foo='bar',
+ baz='bak')
+ inherited_config_1 = base_config.derive(qzr='flp')
+ inherited_config_2 = inherited_config_1.derive(
+ cbuildbot_config.delete_keys(base_config))
+ self.assertEqual(inherited_config_2, {'qzr': 'flp'})
class CBuildBotTest(cros_test_lib.MoxTestCase):
"""General tests of cbuildbot_config with respect to cbuildbot."""