Back to index

python3.2  3.2.2
Public Member Functions
ctypes.test.test_struct_fields.StructFieldsTestCase Class Reference

List of all members.

Public Member Functions

def test_1_A
def test_1_B
def test_2
def test_3
def test_4

Detailed Description

Definition at line 4 of file test_struct_fields.py.


Member Function Documentation

Definition at line 15 of file test_struct_fields.py.

00015 
00016     def test_1_A(self):
00017         class X(Structure):
00018             pass
00019         self.assertEqual(sizeof(X), 0) # not finalized
00020         X._fields_ = [] # finalized
00021         self.assertRaises(AttributeError, setattr, X, "_fields_", [])

Definition at line 22 of file test_struct_fields.py.

00022 
00023     def test_1_B(self):
00024         class X(Structure):
00025             _fields_ = [] # finalized
00026         self.assertRaises(AttributeError, setattr, X, "_fields_", [])

Here is the call graph for this function:

Definition at line 27 of file test_struct_fields.py.

00027 
00028     def test_2(self):
00029         class X(Structure):
00030             pass
00031         X()
00032         self.assertRaises(AttributeError, setattr, X, "_fields_", [])

Definition at line 33 of file test_struct_fields.py.

00033 
00034     def test_3(self):
00035         class X(Structure):
00036             pass
00037         class Y(Structure):
00038             _fields_ = [("x", X)] # finalizes X
00039         self.assertRaises(AttributeError, setattr, X, "_fields_", [])

Definition at line 40 of file test_struct_fields.py.

00040 
00041     def test_4(self):
00042         class X(Structure):
00043             pass
00044         class Y(X):
00045             pass
00046         self.assertRaises(AttributeError, setattr, X, "_fields_", [])
00047         Y._fields_ = []
00048         self.assertRaises(AttributeError, setattr, X, "_fields_", [])


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