Fixed #18 : Parsing and evaluating Python
This commit is contained in:
+10
-4
@@ -1,6 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from helpers import GetNextId
|
||||
from server.authentication import User
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -25,12 +26,12 @@ def on_new_module(sheerka, request):
|
||||
:rtype:
|
||||
"""
|
||||
from core.Event import Event
|
||||
from core.ExecutionContext import ExecutionContext, ExecutionContextActions
|
||||
from core.ExecutionContext import ExecutionContext, ContextActions
|
||||
module_name = request.module.__name__.split(".")[-1]
|
||||
context = ExecutionContext("test",
|
||||
Event(message=f"Executing module {module_name}"),
|
||||
sheerka,
|
||||
ExecutionContextActions.TESTING,
|
||||
ContextActions.TESTING,
|
||||
None)
|
||||
|
||||
ontology = sheerka.om.push_ontology(module_name)
|
||||
@@ -41,12 +42,12 @@ def on_new_module(sheerka, request):
|
||||
@pytest.fixture(scope="function")
|
||||
def context(sheerka):
|
||||
from core.Event import Event
|
||||
from core.ExecutionContext import ExecutionContext, ExecutionContextActions
|
||||
from core.ExecutionContext import ExecutionContext, ContextActions
|
||||
|
||||
return ExecutionContext("test",
|
||||
Event(message=""),
|
||||
sheerka,
|
||||
ExecutionContextActions.TESTING,
|
||||
ContextActions.TESTING,
|
||||
None)
|
||||
|
||||
|
||||
@@ -55,6 +56,11 @@ def next_id():
|
||||
return GetNextId()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def user():
|
||||
return User(username="johan doe", email="johan.doe@sheerka.com", firstname="johan", lastname="doe")
|
||||
|
||||
|
||||
class TestUsingFileBasedSheerka:
|
||||
@pytest.fixture(scope="class")
|
||||
def sheerka(self):
|
||||
|
||||
Reference in New Issue
Block a user