mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Add OrderedDict test for PEP 468 (guaranteed ordered of kwargs)
This commit is contained in:
parent
d15bb26248
commit
ec53b07ef1
1 changed files with 8 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue