Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_funcattrs.FunctionDocstringTest Class Reference
Inheritance diagram for test.test_funcattrs.FunctionDocstringTest:
Inheritance graph
[legend]
Collaboration diagram for test.test_funcattrs.FunctionDocstringTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_set_docstring_attr
def test_delete_docstring
def setUp
def cannot_set_attr

Public Attributes

 fi
 F
 b

Detailed Description

Definition at line 258 of file test_funcattrs.py.


Member Function Documentation

def test.test_funcattrs.FuncAttrsTest.cannot_set_attr (   self,
  obj,
  name,
  value,
  exceptions 
) [inherited]

Definition at line 16 of file test_funcattrs.py.

00016 
00017     def cannot_set_attr(self, obj, name, value, exceptions):
00018         try:
00019             setattr(obj, name, value)
00020         except exceptions:
00021             pass
00022         else:
00023             self.fail("shouldn't be able to set %s to %r" % (name, value))
00024         try:
00025             delattr(obj, name)
00026         except exceptions:
00027             pass
00028         else:
00029             self.fail("shouldn't be able to del %s" % name)
00030 

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_funcattrs.FuncAttrsTest.setUp (   self) [inherited]

Definition at line 6 of file test_funcattrs.py.

00006 
00007     def setUp(self):
00008         class F:
00009             def a(self):
00010                 pass
00011         def b():
00012             return 3
00013         self.fi = F()
00014         self.F = F
00015         self.b = b

Here is the caller graph for this function:

Definition at line 268 of file test_funcattrs.py.

00268 
00269     def test_delete_docstring(self):
00270         self.b.__doc__ = "The docstring"
00271         del self.b.__doc__
00272         self.assertEqual(self.b.__doc__, None)
00273 

Here is the call graph for this function:

Definition at line 259 of file test_funcattrs.py.

00259 
00260     def test_set_docstring_attr(self):
00261         self.assertEqual(self.b.__doc__, None)
00262         docstr = "A test method that does nothing"
00263         self.b.__doc__ = docstr
00264         self.F.a.__doc__ = docstr
00265         self.assertEqual(self.b.__doc__, docstr)
00266         self.assertEqual(self.fi.a.__doc__, docstr)
00267         self.cannot_set_attr(self.fi.a, "__doc__", docstr, AttributeError)

Here is the call graph for this function:


Member Data Documentation

Definition at line 14 of file test_funcattrs.py.

Definition at line 13 of file test_funcattrs.py.

Definition at line 12 of file test_funcattrs.py.


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