Added ModifyConcept function, and fixed 'isa' not working

This commit is contained in:
2020-02-20 11:30:53 +01:00
parent 87f232b527
commit 7cd94e888f
17 changed files with 750 additions and 228 deletions
@@ -51,18 +51,20 @@ class TestAddConceptInSetEvaluator(TestUsingMemoryBasedSheerka):
assert res.value.body == "bar"
def test_i_can_add_concept_to_a_set_of_concept(self):
context = self.get_context()
foo = Concept("foo")
context.sheerka.create_new_concept(context, foo)
bar = Concept("bar")
context.sheerka.create_new_concept(context, bar)
sheerka, context, foo, bar = self.init_concepts("foo", "bar", create_new=True)
ret_val = get_ret_val("foo", "bar")
res = AddConceptInSetEvaluator().eval(context, ret_val)
foo = sheerka.new("foo") # reload it
assert res.status
assert context.sheerka.isinstance(res.value, BuiltinConcepts.SUCCESS)
assert context.sheerka.isaset(context, bar)
assert context.sheerka.isinset(foo, bar)
assert context.sheerka.isa(foo, bar)
foo_from_sheerka = context.sheerka.get("foo")
assert foo_from_sheerka.get_prop(BuiltinConcepts.ISA) == [bar]
def test_i_can_add_concept_with_a_body_to_a_set_of_concept(self):
context = self.get_context()