def test_substitute(dir_location, attack_version, rev):
    """Tests substitute.py with both frameworks"""
    dashed_rev = rev.replace('_', '-')
    attack_version_filepath = attack_version.replace('.', '_')[1:]  # turn v10.1 into 10_1
    rx_controls = pathlib.Path(dir_location, "frameworks", f"attack_{attack_version_filepath}", rev,
                               "stix", f"{dashed_rev}-controls.json")
    with open(rx_controls, "r") as f:
        rx_controls = json.load(f)["objects"]
    rx_mappings = pathlib.Path(dir_location, "frameworks", f"attack_{attack_version_filepath}", rev,
                               "stix", f"{dashed_rev}-mappings.json")
    with open(rx_mappings, "r") as f:
        rx_mappings = json.load(f)["objects"]
    output_location = pathlib.Path(dir_location, "frameworks", f"attack_{attack_version_filepath}", rev,
                                   "stix", f"{dashed_rev}-enterprise-attack.json")
    attack_data = get_attack_data(dir_location, attack_version)

    substitute.main(
        attack_data=attack_data,
        controls=rx_controls,
        mappings=rx_mappings,
        output=output_location,
        allow_unmapped=True
    )
Tests substitute.py with both frameworks
tests/test_scripts.py