Implemented dictionnary based file system to speed up the tests
This commit is contained in:
@@ -1,33 +1,9 @@
|
||||
import pytest
|
||||
from os import path
|
||||
import shutil
|
||||
import os
|
||||
|
||||
from core.builtin_concepts import ParserResultConcept, BuiltinConcepts
|
||||
from core.builtin_concepts import BuiltinConcepts
|
||||
from core.concept import Concept, Property
|
||||
from core.sheerka import Sheerka, ExecutionContext
|
||||
from core.tokenizer import Tokenizer
|
||||
from parsers.DefaultParser import DefaultParser
|
||||
from parsers.ExactConceptParser import ExactConceptParser
|
||||
|
||||
tests_root = path.abspath("../build/tests")
|
||||
root_folder = "init_folder"
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def init_test():
|
||||
if path.exists(tests_root):
|
||||
shutil.rmtree(tests_root)
|
||||
|
||||
if not path.exists(tests_root):
|
||||
os.makedirs(tests_root)
|
||||
current_pwd = os.getcwd()
|
||||
os.chdir(tests_root)
|
||||
|
||||
yield None
|
||||
|
||||
os.chdir(current_pwd)
|
||||
|
||||
|
||||
def test_i_can_compute_combinations():
|
||||
parser = ExactConceptParser()
|
||||
@@ -150,7 +126,7 @@ def test_i_can_detect_concept_from_tokens():
|
||||
|
||||
def get_context():
|
||||
sheerka = Sheerka()
|
||||
sheerka.initialize(root_folder)
|
||||
sheerka.initialize("mem://")
|
||||
|
||||
return ExecutionContext("sheerka", "xxxx", sheerka)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user