Test that the class vars are set correctly. Args: test_state: A state.
(test_state)
| 346 | |
| 347 | |
| 348 | def test_base_class_vars(test_state): |
| 349 | """Test that the class vars are set correctly. |
| 350 | |
| 351 | Args: |
| 352 | test_state: A state. |
| 353 | """ |
| 354 | fields = test_state.get_fields() |
| 355 | cls = type(test_state) |
| 356 | |
| 357 | for field_name in fields: |
| 358 | if field_name.startswith("_") or field_name in cls.get_skip_vars(): |
| 359 | continue |
| 360 | prop = getattr(cls, field_name) |
| 361 | assert isinstance(prop, Var) |
| 362 | assert prop._js_expr.split(".")[-1] == field_name + FIELD_MARKER |
| 363 | |
| 364 | assert cls.num1._var_type is int |
| 365 | assert cls.num2._var_type is float |
| 366 | assert cls.key._var_type is str |
| 367 | |
| 368 | |
| 369 | def test_computed_class_var(test_state): |
nothing calls this directly
no test coverage detected