You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
533 B
22 lines
533 B
import unittest
|
|
from ctypes import *
|
|
|
|
class X(Structure):
|
|
_fields_ = [("foo", c_int)]
|
|
|
|
class TestCase(unittest.TestCase):
|
|
def test_simple(self):
|
|
self.assertRaises(TypeError,
|
|
delattr, c_int(42), "value")
|
|
|
|
def test_chararray(self):
|
|
self.assertRaises(TypeError,
|
|
delattr, (c_char * 5)(), "value")
|
|
|
|
def test_struct(self):
|
|
self.assertRaises(TypeError,
|
|
delattr, X(), "foo")
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|