Fixed #100 : SheerkaAdmin: Add builtins() command

Fixed #99 : SheerkaQueryManager: I can manage contains predicate when filtering objects
Fixed #97 : ERROR: list indices must be integers or slices, not Concept
Fixed #96 : SequenceNodeParser: SequenceNodeParser must correctly handle concept definition
Fixed #95 : ResolveAmbiguity must not remove concepts that do not require evaluation
Fixed #94 : Concepts with the same key are lost when new ontology
Fixed #93 : Introduce BuiltinConcepts.EVAL_GLOBAL_TRUTH_REQUESTED
Fixed #92 : ExpressionParser: Implement compile_disjunctions()
Fixed #91 : Implement get_concepts_complexity(context, concepts, concept_parts)
Fixed #90 : ResolveAmbiguity : where predicate is not used to resolve ambiguity
Fixed #89 : ResolveAmbiguityEvaluator: Concepts embedded in ConceptNode are not resolved
Fixed #88: SyaNodeParser: Parse multiple parameters when some of the are not recognized
Fixed #87: SyaNodeParser : Parse the multiple parameters
This commit is contained in:
2021-07-31 08:52:00 +02:00
parent 7dcaa9c111
commit e69745adc8
70 changed files with 1561 additions and 455 deletions
+18
View File
@@ -193,6 +193,8 @@ def test_i_can_escape():
("c:|id:", None, "id"),
("c:key|:", "key", None),
("c:key|id:x", None, None),
("c:one: plus c:two:", None, None),
("c:one|id: plus c:two:", None, None),
])
def test_i_can_unstr_concept(text, expected_key, expected_id):
k, i = core.utils.unstr_concept(text)
@@ -494,3 +496,19 @@ def test_sheerka_hasattr_get_attr():
assert not core.utils.sheerka_hasattr(concept, "b")
with pytest.raises(AttributeError):
core.utils.sheerka_getattr(concept, "b")
def test_i_can_replace_after():
my_new_items = ["alpha", "beta", "gamma"]
my_list1 = ["a", "b", "c", "d"]
core.utils.replace_after(my_list1, "c", my_new_items)
assert my_list1 == ["a", "b", "alpha", "beta", "gamma"]
my_list2 = ["a", "b", "c", "d"]
core.utils.replace_after(my_list2, "a", my_new_items)
assert my_list2 == ["alpha", "beta", "gamma"]
with pytest.raises(KeyError):
my_list3 = ["a", "b", "c", "d"]
core.utils.replace_after(my_list3, "x", my_new_items)