From 4d01531f91e4b20db2cb6ff738ee9af724ed2bf1 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 11 Jan 2012 13:22:36 -0800 Subject: Makes common/cfg.py raise AttributeError * fixes bug 915039 * includes test Change-Id: I67b886be3b5af3763f52fffe54085975d61d61eb --- nova/tests/test_cfg.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/test_cfg.py b/nova/tests/test_cfg.py index b70b7838a..440b7acc7 100644 --- a/nova/tests/test_cfg.py +++ b/nova/tests/test_cfg.py @@ -598,6 +598,11 @@ class SadPathTestCase(BaseTestCase): self.assertFalse(hasattr(self.conf, 'foo')) self.assertRaises(NoSuchOptError, getattr, self.conf, 'foo') + def test_unknown_attr_is_attr_error(self): + self.conf([]) + self.assertFalse(hasattr(self.conf, 'foo')) + self.assertRaises(AttributeError, getattr, self.conf, 'foo') + def test_unknown_group_attr(self): self.conf.register_group(OptGroup('blaa')) -- cgit