Skip to content

Test enum and string values in household calculations without axes #4147

Closed

Description

@anth-volk

PolicyEngineCountry.calculate formats each value of a household calculation without axes by the variable's value_type. Since #4136 moved the SPM country tests onto stand-in simulations, every unit test that calls it uses float or int variables, so no test reaches the Enum branch (result.decode()[entity_index].name) or the str branch (str(result[entity_index])). Only the removed full-model calculations reached them, and codecov/project fell 0.03 points on #4136.

Add a unit test over a stand-in simulation that calculates an enum variable and a string variable for a household without axes, and checks that the result holds the enum member's name and a plain str. The axes path is already covered by the _serialize_axis_result tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions