def test_set_config_None(self): """ Setting `None` via :func:`config.set_config_data` also works and does not raise exceptions on subsequent update or get """ config.set_config_data(None) self.assertIsNone(config.config_value("a")) config.update_config_data("a.b", 2)
def test_update_config_existing(self): """ :func:`~config.update_config_data` will update existing config and not remove others """ config.update_config_data("baz.bax", "new") self.assertEqual(config.config_value("baz.bax"), "new") self.assertEqual(config.config_value("foo"), "bar")
def test_update_config_new(self): """ :func:`~config.update_config_data` will add new config and not remove others """ config.update_config_data("baz.new", "wha") config.update_config_data("baz.some.other", "who") self.assertEqual(config.config_value("baz.new"), "wha") self.assertEqual(config.config_value("baz.some.other"), "who") self.assertEqual(config.config_value("baz.bax"), "quux")
def set_non_conv_tenant(tenant_id, testcase): """ Set tenant_id as non convergence tenant """ update_config_data("non-convergence-tenants", [tenant_id]) testcase.addCleanup(set_config_data, {})