def test_yaml():
    """
    .
    """
    mission = Mission("test", "faction", 125, "b", 6)
    assert mission.yaml() == "\n".join([
        "-",
        "  name: test",
        "  faction: faction",
        "  reward: 125",
        "  min-quality: b",
        "  passengers: 6",
        "\n",
    ]), "YAML for mission correct"
Exemple #2
0
def write_mission_file(mission: Mission):
    """
    Actually record results in the mission file
    """
    with open("missions.yaml", "a") as mission_file:
        mission_file.write(mission.yaml())