Back to index

python3.2  3.2.2
Public Member Functions
ctypes.test.test_structures.TestRecursiveStructure Class Reference

List of all members.

Public Member Functions

def test_contains_itself
def test_vice_versa

Detailed Description

Definition at line 412 of file test_structures.py.


Member Function Documentation

Definition at line 413 of file test_structures.py.

00413 
00414     def test_contains_itself(self):
00415         class Recursive(Structure):
00416             pass
00417 
00418         try:
00419             Recursive._fields_ = [("next", Recursive)]
00420         except AttributeError as details:
00421             self.assertTrue("Structure or union cannot contain itself" in
00422                             str(details))
00423         else:
00424             self.fail("Structure or union cannot contain itself")
00425 

Definition at line 426 of file test_structures.py.

00426 
00427     def test_vice_versa(self):
00428         class First(Structure):
00429             pass
00430         class Second(Structure):
00431             pass
00432 
00433         First._fields_ = [("second", Second)]
00434 
00435         try:
00436             Second._fields_ = [("first", First)]
00437         except AttributeError as details:
00438             self.assertTrue("_fields_ is final" in
00439                             str(details))
00440         else:
00441             self.fail("AttributeError not raised")


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