Skip to content

Commit

Permalink
chore: sync project template
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Dec 28, 2023
1 parent 9aef24d commit 1bed503
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/DHARPA-Project/kiara_plugin.develop.git",
"commit": "93c09653eb11580d7b56c632cccf3d3cb2594954",
"commit": "a7849bcc8a7aee2b98eaa7fad5505a8784545c78",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ classifiers = [
"Programming Language :: Python :: 3.12"
]
dependencies = [
"kiara>=0.5.7,<0.6.0",
"kiara>=0.5.8,<0.6.0",
"kiara_plugin.core_types>=0.5.0,<0.6.0",
"kiara_plugin.tabular>=0.5.1,<0.6.0",
]
Expand Down
31 changes: 28 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

from kiara.context import KiaraConfig
from kiara.interfaces.python_api import KiaraAPI
from kiara.interfaces.python_api.models.job import JobTest
from kiara.utils.testing import get_tests_for_job, list_job_descs
from kiara.interfaces.python_api.models.job import JobDesc, JobTest
from kiara.utils.testing import get_init_job, get_tests_for_job, list_job_descs

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
JOBS_FOLDER = Path(os.path.join(ROOT_DIR, "examples", "jobs"))
Expand All @@ -36,6 +36,10 @@ def create_temp_dir():
return instance_path


def get_job_alias(job_desc: JobDesc) -> str:
return job_desc.job_alias


@pytest.fixture
def kiara_api() -> KiaraAPI:

Expand All @@ -45,7 +49,28 @@ def kiara_api() -> KiaraAPI:
return api


@pytest.fixture(params=list_job_descs(JOBS_FOLDER))
@pytest.fixture
def kiara_api_init_example() -> KiaraAPI:
instance_path = create_temp_dir()
kc = KiaraConfig.create_in_folder(instance_path)
api = KiaraAPI(kc)

init_job = get_init_job(JOBS_FOLDER)
if init_job is None:
return api

results = api.run_job(init_job)

if not init_job.save:
return api

for field_name, alias_name in init_job.save.items():
api.store_value(results[field_name], alias_name)

return api


@pytest.fixture(params=list_job_descs(JOBS_FOLDER), ids=get_job_alias)
def example_job_test(request, kiara_api) -> JobTest:

job_tests_folder = Path(os.path.join(ROOT_DIR, "tests", "job_tests"))
Expand Down

0 comments on commit 1bed503

Please sign in to comment.