mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-98512: Add more tests for ValuesView
(#98515)
This commit is contained in:
parent
1fd20d0b57
commit
29e027c3e6
2 changed files with 6 additions and 0 deletions
|
@ -1602,6 +1602,7 @@ class TestCollectionABCs(ABCTestCase):
|
||||||
containers = [
|
containers = [
|
||||||
seq,
|
seq,
|
||||||
ItemsView({1: nan, 2: obj}),
|
ItemsView({1: nan, 2: obj}),
|
||||||
|
KeysView({1: nan, 2: obj}),
|
||||||
ValuesView({1: nan, 2: obj})
|
ValuesView({1: nan, 2: obj})
|
||||||
]
|
]
|
||||||
for container in containers:
|
for container in containers:
|
||||||
|
@ -1865,6 +1866,8 @@ class TestCollectionABCs(ABCTestCase):
|
||||||
mymap['red'] = 5
|
mymap['red'] = 5
|
||||||
self.assertIsInstance(mymap.keys(), Set)
|
self.assertIsInstance(mymap.keys(), Set)
|
||||||
self.assertIsInstance(mymap.keys(), KeysView)
|
self.assertIsInstance(mymap.keys(), KeysView)
|
||||||
|
self.assertIsInstance(mymap.values(), Collection)
|
||||||
|
self.assertIsInstance(mymap.values(), ValuesView)
|
||||||
self.assertIsInstance(mymap.items(), Set)
|
self.assertIsInstance(mymap.items(), Set)
|
||||||
self.assertIsInstance(mymap.items(), ItemsView)
|
self.assertIsInstance(mymap.items(), ItemsView)
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,9 @@ class DictSetTest(unittest.TestCase):
|
||||||
self.assertIsInstance(d.values(), collections.abc.ValuesView)
|
self.assertIsInstance(d.values(), collections.abc.ValuesView)
|
||||||
self.assertIsInstance(d.values(), collections.abc.MappingView)
|
self.assertIsInstance(d.values(), collections.abc.MappingView)
|
||||||
self.assertIsInstance(d.values(), collections.abc.Sized)
|
self.assertIsInstance(d.values(), collections.abc.Sized)
|
||||||
|
self.assertIsInstance(d.values(), collections.abc.Collection)
|
||||||
|
self.assertIsInstance(d.values(), collections.abc.Iterable)
|
||||||
|
self.assertIsInstance(d.values(), collections.abc.Container)
|
||||||
|
|
||||||
self.assertIsInstance(d.items(), collections.abc.ItemsView)
|
self.assertIsInstance(d.items(), collections.abc.ItemsView)
|
||||||
self.assertIsInstance(d.items(), collections.abc.MappingView)
|
self.assertIsInstance(d.items(), collections.abc.MappingView)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue