MCPcopy Create free account
hub / github.com/dot-agent/nextpy / test_base_class_vars

Function test_base_class_vars

tests/test_state.py:220–238  ·  view source on GitHub ↗

Test that the class vars are set correctly. Args: test_state: A state.

(test_state)

Source from the content-addressed store, hash-verified

218
219
220def test_base_class_vars(test_state):
221 """Test that the class vars are set correctly.
222
223 Args:
224 test_state: A state.
225 """
226 fields = test_state.get_fields()
227 cls = type(test_state)
228
229 for field in fields:
230 if field in test_state.get_skip_vars():
231 continue
232 prop = getattr(cls, field)
233 assert isinstance(prop, BaseVar)
234 assert prop._var_name == field
235
236 assert cls.num1._var_type == int
237 assert cls.num2._var_type == float
238 assert cls.key._var_type == str
239
240
241def test_computed_class_var(test_state):

Callers

nothing calls this directly

Calls 2

get_fieldsMethod · 0.80
get_skip_varsMethod · 0.80

Tested by

no test coverage detected