def test_class_indexing_with_vars():
    """Test that we can index into a state var with another var."""
    prop = TestState.array[TestState.num1]  # pyright: ignore [reportCallIssue, reportArgumentType]
    assert str(prop) == f"{TestState.get_name()}.array.at({TestState.get_name()}.num1)"

    prop = TestState.mapping["a"][TestState.num1]  # pyright: ignore [reportCallIssue, reportArgumentType]
    assert (
        str(prop)
        == f'{TestState.get_name()}.mapping["a"].at({TestState.get_name()}.num1)'
    )

    prop = TestState.mapping[TestState.map_key]
    assert (
        str(prop) == f"{TestState.get_name()}.mapping[{TestState.get_name()}.map_key]"
    )
Test that we can index into a state var with another var.
tests/units/test_state.py