From ac3895acd878c2e505d6c55284449ccbbdb76480 Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Thu, 17 Sep 2020 19:03:29 +0200 Subject: [PATCH] Updated flatten method, now raise KeyError in case of existing key. --- tests/dicts/test_benedict.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/dicts/test_benedict.py b/tests/dicts/test_benedict.py index 2afbaed..15cb8f6 100644 --- a/tests/dicts/test_benedict.py +++ b/tests/dicts/test_benedict.py @@ -474,14 +474,15 @@ class benedict_test_case(unittest.TestCase): }, } b = benedict(d) - f = b.flatten() - r = { - 'a': 1, - 'b': 2, - 'c_d': 4, - } - self.assertEqual(f, r) - self.assertFalse(b is f) + with self.assertRaises(KeyError): + f = b.flatten() + # r = { + # 'a': 1, + # 'b': 2, + # 'c_d': 4, + # } + # self.assertEqual(f, r) + # self.assertFalse(b is f) def test_fromkeys(self): k = [