def test_encode_no_tricks_are_removed():
    from_json = TrickLevelConfiguration.from_json(
        {
            "minimal_logic": False,
            "specific_levels": {
                "Dash": "disabled"
            }
        },
        game=RandovaniaGame.METROID_PRIME_ECHOES)

    encoded, byte_count = bitpacking.pack_results_and_bit_count(
        from_json.bit_pack_encode({}))

    assert encoded == b'\x00\x00\x00\x00'
    assert byte_count == 26

    decoder = BitPackDecoder(encoded)
    decoded = TrickLevelConfiguration.bit_pack_unpack(
        decoder, {
            "reference":
            TrickLevelConfiguration(False, {},
                                    RandovaniaGame.METROID_PRIME_ECHOES),
        })

    assert decoded.specific_levels == {}
def _trick_level_data(request, mocker, echoes_game_description):
    tricks = echoes_game_description.resource_database.trick[:14]
    mocker.patch(
        "randovania.layout.base.trick_level_configuration._all_tricks",
        return_value=tricks)
    return (request.param["encoded"], request.param["bit_count"],
            TrickLevelConfiguration.from_json(
                request.param["json"],
                game=RandovaniaGame.METROID_PRIME_ECHOES))