From ec53b07ef1dabea192d6566b78e6f12d329967a6 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 8 Jan 2017 00:37:13 -0800 Subject: Add OrderedDict test for PEP 468 (guaranteed ordered of kwargs) --- Lib/test/test_ordered_dict.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index a35ed12..93f812a 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -52,6 +52,14 @@ class OrderedDictTests: self.assertEqual(list(d.items()), [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)]) + def test_468(self): + OrderedDict = self.OrderedDict + items = [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)] + shuffle(items) + argdict = OrderedDict(items) + d = OrderedDict(**argdict) + self.assertEqual(list(d.items()), items) + def test_update(self): OrderedDict = self.OrderedDict with self.assertRaises(TypeError): -- cgit v0.12