Added simple form of concept composition
This commit is contained in:
@@ -41,17 +41,19 @@ def to_str_ast(expression):
|
||||
return PythonNode.get_dump(ast.parse(expression, mode="eval"))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("text", [
|
||||
"not parser result",
|
||||
ParserResultConcept(value="not a list"),
|
||||
ParserResultConcept(value=[]),
|
||||
ParserResultConcept(value=["not a Node"]),
|
||||
@pytest.mark.parametrize("text, interested", [
|
||||
("not parser result", False),
|
||||
(ParserResultConcept(parser="not multiple_concepts_parser"), False),
|
||||
(ParserResultConcept(parser=multiple_concepts_parser, value=[]), True),
|
||||
])
|
||||
def test_not_interested(text):
|
||||
def test_not_interested(text, interested):
|
||||
context = get_context()
|
||||
|
||||
res = PythonWithConceptsParser().parse(context, text)
|
||||
assert res is None
|
||||
if interested:
|
||||
assert res is not None
|
||||
else:
|
||||
assert res is None
|
||||
|
||||
|
||||
def test_i_can_parse_concepts_and_python():
|
||||
|
||||
Reference in New Issue
Block a user