ยปCore Development>Code coverage>Lib/ctypes/test/test_delattr.py

Python code coverage for Lib/ctypes/test/test_delattr.py

#countcontent
1n/aimport unittest
2n/afrom ctypes import *
3n/a
4n/aclass X(Structure):
5n/a _fields_ = [("foo", c_int)]
6n/a
7n/aclass TestCase(unittest.TestCase):
8n/a def test_simple(self):
9n/a self.assertRaises(TypeError,
10n/a delattr, c_int(42), "value")
11n/a
12n/a def test_chararray(self):
13n/a self.assertRaises(TypeError,
14n/a delattr, (c_char * 5)(), "value")
15n/a
16n/a def test_struct(self):
17n/a self.assertRaises(TypeError,
18n/a delattr, X(), "foo")
19n/a
20n/aif __name__ == "__main__":
21n/a unittest.main()