Fixed #12
Fixed #13
Fixed #14
This commit is contained in:
2023-05-08 17:50:28 +02:00
parent 21a397861a
commit e41094f908
95 changed files with 12168 additions and 260 deletions
+36
View File
@@ -0,0 +1,36 @@
from os import path
from base import UsingFileBasedSheerka
from helpers import get_concept, get_concepts, get_file_content
class TestSheerka(UsingFileBasedSheerka):
def test_i_can_initialize_sheerka(self, sheerka_fb):
sheerka = sheerka_fb
assert path.exists(self.SHEERKA_ROOT_DIR)
last_event_path = path.join(self.SHEERKA_ROOT_DIR, "LAST_EVENT")
assert path.exists(last_event_path)
last_event_digest = get_file_content(last_event_path)
last_event_folder = path.join(self.SHEERKA_ROOT_DIR, "events", last_event_digest[:24], last_event_digest)
assert path.exists(last_event_folder)
assert path.exists(last_event_folder + "_admin_context")
assert len(sheerka.services) > 0
assert len(sheerka.evaluators) > 0
# add test to validate that we can access bind methods
def test_i_can_use_isinstance(self, sheerka, context):
foo, bar = get_concepts(context, "foo", "bar", use_sheerka=True)
assert sheerka.isinstance(foo, foo.key)
assert sheerka.isinstance(foo, foo.str_id)
assert sheerka.isinstance(foo, foo)
assert sheerka.isinstance(foo, foo.get_metadata())
assert not sheerka.isinstance(foo, bar.key)
assert not sheerka.isinstance(foo, bar.str_id)
assert not sheerka.isinstance(foo, bar)
assert not sheerka.isinstance(foo, bar.get_metadata())