MCPcopy Index your code
hub / github.com/LabPy/lantz / test_derived_class

Method test_derived_class

lantz/testsuite/test_driver.py:172–267  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

170 self.assertEqual(fut.result(), {'eggs': 3, 'ham': 23})
171
172 def test_derived_class(self):
173
174 class X(Driver):
175
176 _val1 = 1
177
178 @Feat()
179 def feat1(self):
180 return 'feat1'
181
182 @Feat()
183 def val1(self):
184 return self._val1
185
186 @val1.setter
187 def val1(self, value):
188 self._val1 = value
189
190 @Action()
191 def action1(self):
192 return 'action1'
193
194 class Y(X):
195
196 _val2 = 1
197
198 @Feat()
199 def feat2(self):
200 return 'feat2'
201
202 @Feat()
203 def val2(self):
204 return self._val2
205
206 @val2.setter
207 def val2(self, value):
208 self._val2 = value
209
210 @Action()
211 def action2(self):
212 return 'action2'
213
214 class Z(X):
215
216 @Feat()
217 def feat1(self):
218 return super().feat1 + ' in Z'
219
220 @Feat()
221 def val1(self):
222 return super().val1
223
224 @val1.setter
225 def val1(self, value):
226 self._val1 = 2 * value
227
228 @Action()
229 def action1(self):

Callers

nothing calls this directly

Calls 10

action1Method · 0.95
action2Method · 0.95
action1Method · 0.95
XClass · 0.85
YClass · 0.85
ZClass · 0.85
NClass · 0.85
refreshMethod · 0.80
setFunction · 0.50
keysMethod · 0.45

Tested by

no test coverage detected