Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_descr.DictProxyTests Class Reference

List of all members.

Public Member Functions

def setUp
def test_iter_keys
def test_iter_values
def test_iter_items
def test_dict_type_with_metaclass
def test_repr

Public Attributes

 C

Detailed Description

Definition at line 4264 of file test_descr.py.


Member Function Documentation

Definition at line 4265 of file test_descr.py.

04265 
04266     def setUp(self):
04267         class C(object):
04268             def meth(self):
04269                 pass
04270         self.C = C

Here is the caller graph for this function:

Definition at line 4296 of file test_descr.py.

04296 
04297     def test_dict_type_with_metaclass(self):
04298         # Testing type of __dict__ when metaclass set...
04299         class B(object):
04300             pass
04301         class M(type):
04302             pass
04303         class C(metaclass=M):
04304             # In 2.3a1, C.__dict__ was a real dict rather than a dict proxy
04305             pass
04306         self.assertEqual(type(C.__dict__), type(B.__dict__))

Definition at line 4287 of file test_descr.py.

04287 
04288     def test_iter_items(self):
04289         # Testing dict-proxy iteritems...
04290         it = self.C.__dict__.items()
04291         self.assertNotIsInstance(it, list)
04292         keys = [item[0] for item in it]
04293         keys.sort()
04294         self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
04295             '__weakref__', 'meth'])

Here is the call graph for this function:

Definition at line 4271 of file test_descr.py.

04271 
04272     def test_iter_keys(self):
04273         # Testing dict-proxy keys...
04274         it = self.C.__dict__.keys()
04275         self.assertNotIsInstance(it, list)
04276         keys = list(it)
04277         keys.sort()
04278         self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
04279             '__weakref__', 'meth'])

Here is the call graph for this function:

Definition at line 4280 of file test_descr.py.

04280 
04281     def test_iter_values(self):
04282         # Testing dict-proxy values...
04283         it = self.C.__dict__.values()
04284         self.assertNotIsInstance(it, list)
04285         values = list(it)
04286         self.assertEqual(len(values), 5)

Here is the call graph for this function:

Definition at line 4307 of file test_descr.py.

04307 
04308     def test_repr(self):
04309         # Testing dict_proxy.__repr__
04310         dict_ = {k: v for k, v in self.C.__dict__.items()}
04311         self.assertEqual(repr(self.C.__dict__), 'dict_proxy({!r})'.format(dict_))
04312 

Here is the call graph for this function:


Member Data Documentation

Definition at line 4269 of file test_descr.py.


The documentation for this class was generated from the following file: