Added first version of DebugManager. Implemented draft of the rule engine
This commit is contained in:
@@ -268,12 +268,12 @@ class TestSheerkaSetsManager(TestUsingMemoryBasedSheerka):
|
||||
create_new=True
|
||||
)
|
||||
|
||||
assert twenties.bnf.elements[1].recurse_id is None
|
||||
assert twenties.get_bnf().elements[1].recurse_id is None
|
||||
|
||||
# update number
|
||||
sheerka.set_isa(context, sheerka.new("one"), number)
|
||||
|
||||
assert twenties.bnf.elements[1].recurse_id == "1003#1002(number)"
|
||||
assert twenties.get_bnf().elements[1].recurse_id == "1003#1002(number)"
|
||||
|
||||
def test_concepts_in_group_cache_is_updated(self):
|
||||
sheerka, context, one, two, number = self.init_concepts("one", "two", "number")
|
||||
@@ -306,7 +306,8 @@ class TestSheerkaSetsManagerUsingFileBasedSheerka(TestUsingFileBasedSheerka):
|
||||
assert sheerka.add_concept_to_set(context, foo, group).status
|
||||
sheerka.cache_manager.commit(context)
|
||||
|
||||
sheerka = self.get_sheerka() # another session
|
||||
sheerka = self.get_sheerka(reset_attrs=False) # another session
|
||||
context = self.get_context(sheerka)
|
||||
assert sheerka.add_concept_to_set(context, bar, group).status
|
||||
|
||||
# I can get the elements
|
||||
@@ -319,7 +320,8 @@ class TestSheerkaSetsManagerUsingFileBasedSheerka(TestUsingFileBasedSheerka):
|
||||
}
|
||||
|
||||
# I can also add a group another elements
|
||||
sheerka = self.get_sheerka()
|
||||
sheerka = self.get_sheerka(reset_attrs=False)
|
||||
context = self.get_context(sheerka)
|
||||
foo3 = Concept("foo3")
|
||||
foo4 = Concept("foo4")
|
||||
for c in [foo3, foo4]:
|
||||
@@ -348,19 +350,19 @@ class TestSheerkaSetsManagerUsingFileBasedSheerka(TestUsingFileBasedSheerka):
|
||||
|
||||
# nothing was previously in ISA
|
||||
foo = sheerka.new(foo.key)
|
||||
assert BuiltinConcepts.ISA not in foo.metadata.props
|
||||
assert BuiltinConcepts.ISA not in foo.get_metadata().props
|
||||
res = sheerka.set_isa(context, foo, group)
|
||||
assert res.status
|
||||
sheerka.cache_manager.commit(context)
|
||||
|
||||
sheerka = self.get_sheerka()
|
||||
sheerka = self.get_sheerka(reset_attrs=False)
|
||||
assert foo.get_prop(BuiltinConcepts.ISA) == {group}
|
||||
assert sheerka.isa(foo, group)
|
||||
assert sheerka.isinset(foo, group)
|
||||
assert sheerka.isaset(context, group)
|
||||
|
||||
# I can do the same for bar
|
||||
sheerka = self.get_sheerka()
|
||||
sheerka = self.get_sheerka(reset_attrs=False)
|
||||
res = sheerka.set_isa(context, bar, group)
|
||||
assert res.status
|
||||
assert bar.get_prop(BuiltinConcepts.ISA) == {group}
|
||||
@@ -371,7 +373,7 @@ class TestSheerkaSetsManagerUsingFileBasedSheerka(TestUsingFileBasedSheerka):
|
||||
sheerka.cache_manager.commit(context)
|
||||
|
||||
# they are both in the same group
|
||||
sheerka = self.get_sheerka()
|
||||
sheerka = self.get_sheerka(reset_attrs=False)
|
||||
all_entries = sheerka.sdp.get(SheerkaSetsManager.CONCEPTS_GROUPS_ENTRY)
|
||||
assert all_entries == {
|
||||
group.id: {foo.id, bar.id}
|
||||
|
||||
Reference in New Issue
Block a user