mirror of https://github.com/python/cpython
Add OrderedDict test for PEP 468 (guaranteed ordered of kwargs)
This commit is contained in:
parent
d15bb26248
commit
ec53b07ef1
|
@ -52,6 +52,14 @@ class OrderedDictTests:
|
||||||
self.assertEqual(list(d.items()),
|
self.assertEqual(list(d.items()),
|
||||||
[('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)])
|
[('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):
|
def test_update(self):
|
||||||
OrderedDict = self.OrderedDict
|
OrderedDict = self.OrderedDict
|
||||||
with self.assertRaises(TypeError):
|
with self.assertRaises(TypeError):
|
||||||
|
|
Loading…
Reference in New Issue