summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dictviews.py
blob: 15c933fcee1bebb99edce0f799298618492fc653 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import unittest
from test import test_support

class DictSetTest(unittest.TestCase):

    def test_dict_keys(self):
        d = {1: 10, "a": "ABC"}
        keys = d.KEYS()
        self.assertEqual(set(keys), {1, "a"})

    def test_dict_items(self):
        d = {1: 10, "a": "ABC"}
        items = d.ITEMS()
        self.assertEqual(set(items), {(1, 10), ("a", "ABC")})

    def test_dict_values(self):
        d = {1: 10, "a": "ABC"}
        values = d.VALUES()
        self.assertEqual(set(values), {10, "ABC"})

def test_main():
    test_support.run_unittest(DictSetTest)

if __name__ == "__main__":
    test_main()