Implemented SheerkaOntology

This commit is contained in:
2021-01-11 15:36:03 +01:00
parent e3c2adb533
commit e26c83a825
119 changed files with 6876 additions and 2002 deletions
+21 -6
View File
@@ -2,11 +2,6 @@ from tests.TestUsingMemoryBasedSheerka import TestUsingMemoryBasedSheerka
class TestSheerkaNonRegDisplay(TestUsingMemoryBasedSheerka):
@classmethod
def teardown_class(cls):
# At the end of the tests, sheerka singleton instance will be corrupted
# Ask for a new one
TestSheerkaNonRegDisplay.singleton_instance = None
def test_i_can_display_results_when_return_values_processing_is_on(self, capsys):
init = [
@@ -27,7 +22,7 @@ class TestSheerkaNonRegDisplay(TestUsingMemoryBasedSheerka):
]
sheerka = self.init_scenario(init)
capsys.readouterr()
sheerka.enable_process_return_values = True
sheerka.evaluate_user_input("desc(foo)")
@@ -72,4 +67,24 @@ props : {}
captured = capsys.readouterr()
assert captured.out == """ReturnValue(who=evaluators.Concept, status=True, value=(1001)foo)
ReturnValue(who=evaluators.Concept, status=True, value=(1002)foo)
"""
def test_i_can_list_ontologies(self, capsys):
init = [
"push_ontology('test 1')",
"push_ontology('test 2')",
"pop_ontology()",
"push_ontology('test 3')",
]
sheerka = self.init_scenario(init)
capsys.readouterr()
sheerka.enable_process_return_values = True
sheerka.evaluate_user_input("ontologies()")
captured = capsys.readouterr()
assert captured.out == """test 3
test 1
#unit_test#
__default__
"""