Implemented SheerkaOntology
This commit is contained in:
@@ -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__
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user