예제 #1
0
def test_enviro_dose():
    tv_json = json.loads(open("tv.json").read())
    tv_json["Mode"] = "Dose"
    tv_json["Route"] = "TRANSMISSIONROUTE_ENVIRONMENTAL"
    with open("tv.json", "w") as tv_writer:
        tv_writer.write(json.dumps(tv_json, indent=4, sort_keys=True))

    tyvac.distribute()
    tyvac.update(1)
    mods = tyvac.get_modifiers()

    eff = tv_json["Changing_Effect"]["Initial_Effect"]
    if eff != 1 - mods[4]:
        print("Failed.")
    else:
        print("Pass.")
예제 #2
0
def test_contact_num():
    tv_json = json.loads(open("tv.json").read())
    tv_json["Mode"] = "Exposures"
    tv_json["Route"] = "TRANSMISSIONROUTE_CONTACT"
    with open("tv.json", "w") as tv_writer:
        tv_writer.write(json.dumps(tv_json, indent=4, sort_keys=True))

    tyvac.distribute()
    tyvac.update(1)
    mods = tyvac.get_modifiers()

    eff = tv_json["Changing_Effect"]["Initial_Effect"]
    if eff != 1 - mods[2]:
        print("Failed.")
    else:
        print("Pass.")