def test_satisfiers_does_not_create_assignment(): satisfiers(Var("j"), test_model, "some_nonexistent_variable") assert "some_nonexistent_variable" not in test_model.assignments
def test_satisfiers_does_not_overwrite_assignment(): model = WorldModel({Mary}, {"j": John}) satisfiers(Var("j"), model, "j") assert model.assignments["j"] == John
def test_satisfiers_alien_set(): sset = satisfiers(Call(Var("Alien"), Var("x")), test_model, "x") assert sset == set()
def test_satisfiers_human_set(): sset = satisfiers(Call(Var("Human"), Var("x")), test_model, "x") assert sset == {John, Mary}
def test_satisfiers_bad_set(): sset = satisfiers(Call(Var("Bad"), Var("x")), test_model, "x") assert sset == {Mary}
def test_satisfiers_good_set(): sset = satisfiers(Call(Var("Good"), Var("x")), test_model, "x") assert sset == {John}