Fixed #32 : concept groups are not correctly updated
Fixed #35 : Refactor test helper class (CNC, CC, CIO) Fixed #36 : Concept values are not used when declared with variable expression Fixed #37 : Objects in memory lose their values are restart Fixed #38 : func(a=b, c) (which is not allowed) raise an exception
This commit is contained in:
@@ -4,7 +4,7 @@ import pytest
|
||||
|
||||
from core.builtin_concepts import ReturnValueConcept, ParserResultConcept, BuiltinConcepts
|
||||
from core.builtin_helpers import CreateObjectIdentifiers
|
||||
from core.concept import Concept, CB
|
||||
from core.concept import Concept
|
||||
from core.sheerka.services.SheerkaConceptManager import SheerkaConceptManager
|
||||
from core.sheerka.services.SheerkaExecute import ParserInput
|
||||
from core.tokenizer import Tokenizer
|
||||
@@ -13,6 +13,7 @@ from parsers.BaseNodeParser import SourceCodeNode, SourceCodeWithConceptNode
|
||||
from parsers.FunctionParser import FunctionParser
|
||||
from parsers.PythonParser import PythonNode, PythonParser
|
||||
from tests.TestUsingMemoryBasedSheerka import TestUsingMemoryBasedSheerka
|
||||
from tests.parsers.parsers_utils import CB, compare_with_test_object
|
||||
|
||||
|
||||
def get_obj_name(obj):
|
||||
@@ -178,7 +179,7 @@ class TestPythonEvaluator(TestUsingMemoryBasedSheerka):
|
||||
evaluated = PythonEvaluator().eval(context, parsed)
|
||||
|
||||
assert evaluated.status
|
||||
assert evaluated.value == CB("foo", 2)
|
||||
compare_with_test_object(evaluated.value, CB("foo", 2))
|
||||
|
||||
def test_i_can_eval_concept_token(self):
|
||||
context = self.get_context()
|
||||
@@ -253,7 +254,7 @@ class TestPythonEvaluator(TestUsingMemoryBasedSheerka):
|
||||
|
||||
all_globals = python_evaluator.get_all_possible_globals(context, my_globals)
|
||||
assert len(all_globals) == 2
|
||||
assert all_globals[0]["foo"] == CB(foo, "foo")
|
||||
compare_with_test_object(all_globals[0]["foo"], CB(foo, "foo"))
|
||||
assert all_globals[1]["foo"] == 'foo' # body is evaluated
|
||||
|
||||
def test_i_can_detect_one_error(self):
|
||||
@@ -284,7 +285,7 @@ class TestPythonEvaluator(TestUsingMemoryBasedSheerka):
|
||||
assert isinstance(error0, PythonEvalError)
|
||||
assert isinstance(error0.error, TypeError)
|
||||
assert error0.error.args[0] == "unsupported operand type(s) for +: 'Concept' and 'int'"
|
||||
assert error0.concepts == {'foo': CB(foo, 'string')}
|
||||
compare_with_test_object(error0.concepts, {'foo': CB(foo, 'string')})
|
||||
|
||||
error1 = evaluated.body.body[1]
|
||||
assert isinstance(error1, PythonEvalError)
|
||||
|
||||
Reference in New Issue
Block a user