From dbf385bd796997ab0e649cbb100cd25a78f7f4ec Mon Sep 17 00:00:00 2001 From: meejah Date: Mon, 4 Jan 2021 19:40:23 -0700 Subject: [PATCH] test: missing config section --- src/allmydata/test/test_node.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/allmydata/test/test_node.py b/src/allmydata/test/test_node.py index 1e0f3020c..74ea6e5eb 100644 --- a/src/allmydata/test/test_node.py +++ b/src/allmydata/test/test_node.py @@ -245,6 +245,20 @@ class TestCase(testutil.SignalMixin, unittest.TestCase): with self.assertRaises(MissingConfigEntry): config.get_config("node", "log_gatherer.furl") + def test_missing_config_section(self): + """ + Enumerating a missing section returns empty dict + """ + basedir = self.mktemp() + fileutil.make_dirs(basedir) + with open(os.path.join(basedir, 'tahoe.cfg'), 'w'): + pass + config = read_config(basedir, "") + self.assertEquals( + config.enumerate_section("not-a-section"), + {} + ) + def test_config_required(self): """ Asking for missing (but required) configuration is an error