Python code coverage for Lib/ctypes/test/test_delattr.py
# | count | content |
---|---|---|
1 | n/a | import unittest |
2 | n/a | from ctypes import * |
3 | n/a | |
4 | n/a | class X(Structure): |
5 | n/a | _fields_ = [("foo", c_int)] |
6 | n/a | |
7 | n/a | class TestCase(unittest.TestCase): |
8 | n/a | def test_simple(self): |
9 | n/a | self.assertRaises(TypeError, |
10 | n/a | delattr, c_int(42), "value") |
11 | n/a | |
12 | n/a | def test_chararray(self): |
13 | n/a | self.assertRaises(TypeError, |
14 | n/a | delattr, (c_char * 5)(), "value") |
15 | n/a | |
16 | n/a | def test_struct(self): |
17 | n/a | self.assertRaises(TypeError, |
18 | n/a | delattr, X(), "foo") |
19 | n/a | |
20 | n/a | if __name__ == "__main__": |
21 | n/a | unittest.main() |