e828acf175
CI / lint (push) Successful in 1m32s
CI / typecheck (push) Successful in 1m38s
CI / lint (pull_request) Successful in 1m30s
CI / typecheck (pull_request) Successful in 1m30s
CI / behave (3.11) (pull_request) Successful in 1m39s
CI / behave (3.12) (pull_request) Successful in 1m39s
CI / build (pull_request) Successful in 1m29s
CI / behave (3.13) (pull_request) Successful in 1m39s
CI / behave (3.11) (push) Successful in 1m39s
CI / behave (3.12) (push) Successful in 1m41s
CI / behave (3.13) (push) Successful in 1m37s
CI / build (push) Successful in 1m30s
ISSUES CLOSED: #1
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
"""
|
|
Common step definitions shared across multiple feature files.
|
|
|
|
This module provides reusable step definitions that are used
|
|
across different feature files, following the DRY principle.
|
|
|
|
Note: Most step definitions are now in specific step files.
|
|
This file is kept for truly common steps that don't belong to a specific feature.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import tempfile
|
|
from pathlib import Path
|
|
from typing import Any
|
|
|
|
from behave import given
|
|
|
|
# Common steps are now implemented in specific step definition files:
|
|
# - ontology_loading_steps.py
|
|
# - class_hierarchy_steps.py
|
|
# - graph_loading_steps.py
|
|
# - resolvers_steps.py
|
|
# - filters_steps.py
|
|
# - observers_steps.py
|
|
# - validation_steps.py
|
|
# - consistency_checking_steps.py
|
|
# - metadata_extraction_steps.py
|
|
# - strategies_steps.py
|
|
|
|
# This file is kept for potential future common steps that don't fit
|
|
# into a specific feature category.
|
|
|
|
|
|
@given("I have a test data directory")
|
|
def step_have_test_data_directory(context: Any) -> None:
|
|
"""
|
|
Initialize a test data directory if it doesn't exist.
|
|
|
|
This ensures test_data_dir is available for all features that need it.
|
|
"""
|
|
if not hasattr(context, "test_data_dir"):
|
|
context.test_data_dir = tempfile.mkdtemp(prefix="cleverrdf_test_")
|
|
context.test_data_path = Path(context.test_data_dir)
|