fix: test_message_iterator.py hangs on Python 3.12
[babeltrace.git] / tests / bindings / python / bt2 / test_package.py
1 #
2 # Copyright (C) 2019 EfficiOS Inc.
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; only version 2
7 # of the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #
18
19 import bt2
20 import unittest
21
22
23 class PackageTestCase(unittest.TestCase):
24 def _assert_in_bt2(self, name):
25 self.assertIn(name, dir(bt2))
26
27
28 _public_names = [
29 '__version__',
30 '_ArrayField',
31 '_ArrayFieldClass',
32 '_ArrayFieldClassConst',
33 '_ArrayFieldConst',
34 '_ArrayValueConst',
35 '_BitArrayField',
36 '_BitArrayFieldClass',
37 '_BitArrayFieldClassConst',
38 '_BitArrayFieldConst',
39 '_BoolField',
40 '_BoolFieldClass',
41 '_BoolFieldClassConst',
42 '_BoolFieldConst',
43 '_BoolValueConst',
44 '_ClockSnapshotConst',
45 '_ComponentClassErrorCause',
46 '_ComponentErrorCause',
47 '_CurrentArrayElementFieldPathItem',
48 '_CurrentOptionContentFieldPathItem',
49 '_DiscardedEventsMessage',
50 '_DiscardedEventsMessageConst',
51 '_DiscardedPacketsMessage',
52 '_DiscardedPacketsMessageConst',
53 '_DoublePrecisionRealField',
54 '_DoublePrecisionRealFieldConst',
55 '_DynamicArrayField',
56 '_DynamicArrayFieldClass',
57 '_DynamicArrayFieldClassConst',
58 '_DynamicArrayFieldConst',
59 '_DynamicArrayWithLengthFieldFieldClass',
60 '_DynamicArrayWithLengthFieldFieldClassConst',
61 '_EnumerationField',
62 '_EnumerationFieldClass',
63 '_EnumerationFieldClassConst',
64 '_EnumerationFieldConst',
65 '_Error',
66 '_ErrorCause',
67 '_EventMessage',
68 '_EventMessageConst',
69 '_FilterComponentClassConst',
70 '_FilterComponentConst',
71 '_IndexFieldPathItem',
72 '_IntegerField',
73 '_IntegerFieldClass',
74 '_IntegerFieldClassConst',
75 '_IntegerFieldConst',
76 '_IntegerValue',
77 '_IntegerValueConst',
78 '_MapValueConst',
79 '_MessageIteratorErrorCause',
80 '_MessageIteratorInactivityMessage',
81 '_MessageIteratorInactivityMessageConst',
82 '_OptionFieldClass',
83 '_OptionFieldClassConst',
84 '_OptionWithBoolSelectorFieldClass',
85 '_OptionWithBoolSelectorFieldClassConst',
86 '_OptionWithIntegerSelectorFieldClass',
87 '_OptionWithIntegerSelectorFieldClassConst',
88 '_OptionWithSelectorFieldClass',
89 '_OptionWithSelectorFieldClassConst',
90 '_OptionWithSignedIntegerSelectorFieldClass',
91 '_OptionWithSignedIntegerSelectorFieldClassConst',
92 '_OptionWithUnsignedIntegerSelectorFieldClass',
93 '_OptionWithUnsignedIntegerSelectorFieldClassConst',
94 '_PacketBeginningMessage',
95 '_PacketBeginningMessageConst',
96 '_PacketEndMessage',
97 '_PacketEndMessageConst',
98 '_RealField',
99 '_RealFieldClass',
100 '_RealFieldClassConst',
101 '_RealFieldConst',
102 '_RealValueConst',
103 '_SignedEnumerationField',
104 '_SignedEnumerationFieldClass',
105 '_SignedEnumerationFieldClassConst',
106 '_SignedEnumerationFieldConst',
107 '_SignedIntegerField',
108 '_SignedIntegerFieldClass',
109 '_SignedIntegerFieldClassConst',
110 '_SignedIntegerFieldConst',
111 '_SignedIntegerRangeConst',
112 '_SignedIntegerRangeSetConst',
113 '_SignedIntegerValueConst',
114 '_SinglePrecisionRealField',
115 '_SinglePrecisionRealFieldConst',
116 '_SinkComponentClassConst',
117 '_SinkComponentConst',
118 '_SourceComponentClassConst',
119 '_SourceComponentConst',
120 '_StaticArrayField',
121 '_StaticArrayFieldClass',
122 '_StaticArrayFieldClassConst',
123 '_StaticArrayFieldConst',
124 '_StreamBeginningMessage',
125 '_StreamBeginningMessageConst',
126 '_StreamEndMessage',
127 '_StreamEndMessageConst',
128 '_StringField',
129 '_StringFieldClass',
130 '_StringFieldClassConst',
131 '_StringFieldConst',
132 '_StringValueConst',
133 '_StructureField',
134 '_StructureFieldClass',
135 '_StructureFieldClassConst',
136 '_StructureFieldConst',
137 '_UnknownClockSnapshot',
138 '_UnsignedEnumerationField',
139 '_UnsignedEnumerationFieldClass',
140 '_UnsignedEnumerationFieldClassConst',
141 '_UnsignedEnumerationFieldConst',
142 '_UnsignedIntegerField',
143 '_UnsignedIntegerFieldClass',
144 '_UnsignedIntegerFieldClassConst',
145 '_UnsignedIntegerFieldConst',
146 '_UnsignedIntegerRangeConst',
147 '_UnsignedIntegerRangeSetConst',
148 '_UnsignedIntegerValueConst',
149 '_UserFilterComponent',
150 '_UserMessageIterator',
151 '_UserSinkComponent',
152 '_UserSourceComponent',
153 '_VariantField',
154 '_VariantField',
155 '_VariantFieldClass',
156 '_VariantFieldClassConst',
157 '_VariantFieldClassWithIntegerSelector',
158 '_VariantFieldClassWithIntegerSelectorConst',
159 '_VariantFieldClassWithoutSelector',
160 '_VariantFieldClassWithoutSelectorConst',
161 '_VariantFieldClassWithSignedIntegerSelector',
162 '_VariantFieldClassWithSignedIntegerSelectorConst',
163 '_VariantFieldClassWithUnsignedIntegerSelector',
164 '_VariantFieldClassWithUnsignedIntegerSelectorConst',
165 '_VariantFieldConst',
166 '_VariantFieldConst',
167 'ArrayValue',
168 'AutoSourceComponentSpec',
169 'BoolValue',
170 'ClockClassOffset',
171 'ComponentClassType',
172 'ComponentDescriptor',
173 'ComponentSpec',
174 'create_value',
175 'EventClassLogLevel',
176 'FieldPathScope',
177 'find_plugin',
178 'find_plugins',
179 'find_plugins_in_path',
180 'get_global_logging_level',
181 'get_minimal_logging_level',
182 'Graph',
183 'IntegerDisplayBase',
184 'Interrupter',
185 'LoggingLevel',
186 'MapValue',
187 'plugin_component_class',
188 'QueryExecutor',
189 'RealValue',
190 'register_plugin',
191 'set_global_logging_level',
192 'SignedIntegerRange',
193 'SignedIntegerRangeSet',
194 'SignedIntegerValue',
195 'StringValue',
196 'TraceCollectionMessageIterator',
197 'UnsignedIntegerRange',
198 'UnsignedIntegerRangeSet',
199 'UnsignedIntegerValue',
200 ]
201
202 for name in _public_names:
203
204 def test_func(self):
205 self._assert_in_bt2(name)
206
207 setattr(PackageTestCase, 'test_has_' + name, test_func)
208
209
210 if __name__ == '__main__':
211 unittest.main()
This page took 0.033079 seconds and 4 git commands to generate.