Added bnf when adding a new concept + Started logging filtering

This commit is contained in:
2019-12-13 20:26:11 +01:00
parent 75c8793d53
commit c668cc46d2
29 changed files with 1487 additions and 190 deletions
+14 -12
View File
@@ -41,7 +41,7 @@ def test_i_can_recognize_a_simple_concept():
assert len(results) == 1
assert results[0].status
assert results[0].value == concept
assert results[0].value.value == concept
def test_i_can_recognize_concepts_defined_several_times():
@@ -53,14 +53,14 @@ def test_i_can_recognize_concepts_defined_several_times():
results = ExactConceptParser().parse(context, source)
assert len(results) == 2
results = sorted(results, key=lambda x: x.value.name) # because of the usage of sets
results = sorted(results, key=lambda x: x.value.value.name) # because of the usage of sets
assert results[0].status
assert results[0].value.name == "hello a"
assert results[0].value.props["a"].value == "world"
assert results[0].value.value.name == "hello a"
assert results[0].value.value.props["a"].value == "world"
assert results[1].status
assert results[1].value.name == "hello world"
assert results[1].value.value.name == "hello world"
def test_i_can_recognize_a_concept_with_variables():
@@ -72,9 +72,10 @@ def test_i_can_recognize_a_concept_with_variables():
assert len(results) == 1
assert results[0].status
assert results[0].value.key == concept.key
assert results[0].value.props["a"].value == "10"
assert results[0].value.props["b"].value == "5"
concept_found = results[0].value.value
assert concept_found.key == concept.key
assert concept_found.props["a"].value == "10"
assert concept_found.props["b"].value == "5"
def test_i_can_recognize_a_concept_with_duplicate_variables():
@@ -86,9 +87,10 @@ def test_i_can_recognize_a_concept_with_duplicate_variables():
assert len(results) == 1
assert results[0].status
assert results[0].value.key == concept.key
assert results[0].value.props["a"].value == "10"
assert results[0].value.props["b"].value == "5"
concept_found = results[0].value.value
assert concept_found.key == concept.key
assert concept_found.props["a"].value == "10"
assert concept_found.props["b"].value == "5"
def test_i_can_manage_unknown_concept():
@@ -121,7 +123,7 @@ def test_i_can_detect_concept_from_tokens():
assert len(results) == 1
assert results[0].status
assert results[0].value == concept
assert results[0].value.value == concept
def get_context():