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:
2021-03-05 11:16:19 +01:00
parent 646c428edb
commit 05577012f3
38 changed files with 1942 additions and 1463 deletions
+17 -4
View File
@@ -120,7 +120,10 @@ class TestSheerkaIsAManager(TestUsingMemoryBasedSheerka):
service.add_concepts_to_set(context, [one, two, three, four, five], number)
assert sheerka.isaset(context, sub_number)
assert set(sheerka.get_set_elements(context, sub_number)) == {one, two, three}
# compare ids, as concepts are evaluated in get_set_elements
actual_ids = set(c.id for c in sheerka.get_set_elements(context, sub_number))
expected_ids = set(c.id for c in [one, two, three])
assert actual_ids == expected_ids
def test_i_can_define_subset_of_subset(self):
sheerka, context, one, two, three, four, five, number, sub_number, sub_sub_number = self.init_concepts(
@@ -137,7 +140,11 @@ class TestSheerkaIsAManager(TestUsingMemoryBasedSheerka):
service.add_concepts_to_set(context, [one, two, three, four, five], number)
assert sheerka.isaset(context, sub_sub_number)
assert set(sheerka.get_set_elements(context, sub_sub_number)) == {three}
# compare ids, as concepts are evaluated in get_set_elements
actual_ids = set(c.id for c in sheerka.get_set_elements(context, sub_sub_number))
expected_ids = set(c.id for c in [three])
assert actual_ids == expected_ids
def test_i_can_define_subset_of_another_set_when_some_concept_do_not_have_a_defined_body(self):
"""
@@ -161,7 +168,10 @@ class TestSheerkaIsAManager(TestUsingMemoryBasedSheerka):
service.add_concepts_to_set(context, [one, two, three, four, five], number)
assert sheerka.isaset(context, sub_number)
assert set(sheerka.get_set_elements(context, sub_number)) == {one, three}
# compare ids, as concepts are evaluated in get_set_elements
actual_ids = set(c.id for c in sheerka.get_set_elements(context, sub_number))
expected_ids = set(c.id for c in [one, three])
assert actual_ids == expected_ids
def test_i_can_define_subset_of_another_set_when_some_concept_are_bnf(self):
"""
@@ -183,7 +193,10 @@ class TestSheerkaIsAManager(TestUsingMemoryBasedSheerka):
service.add_concepts_to_set(context, [one, two, twenty, twenties], number)
assert sheerka.isaset(context, sub_number)
assert sheerka.get_set_elements(context, sub_number) == [twenty] # what is expected ?
# compare ids, as concepts are evaluated in get_set_elements
actual_ids = set(c.id for c in sheerka.get_set_elements(context, sub_number))
expected_ids = set(c.id for c in [twenty])
assert actual_ids == expected_ids
def test_bnf_elements_can_be_part_of_a_set(self):
"""