fix: resolve lint and duplicate step definition issues in milestone plan navigation tests
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 25s
CI / push-validation (pull_request) Successful in 27s
CI / helm (pull_request) Successful in 27s
CI / quality (pull_request) Successful in 39s
CI / typecheck (pull_request) Successful in 54s
CI / security (pull_request) Successful in 56s
CI / e2e_tests (pull_request) Successful in 4m3s
CI / integration_tests (pull_request) Successful in 4m6s
CI / unit_tests (pull_request) Failing after 5m39s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m35s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-regression (pull_request) Successful in 57m27s

- Fix import ordering: move pathlib before typing, add blank line before third-party imports
- Remove unnecessary 'r' mode argument from open() call (defaults to read mode)
- Remove duplicate step definition for 'the content should contain' that already exists in uko_ontology_registry_steps.py
- Keep only unique step definitions specific to milestone plan navigation

This resolves the CI failures:
- ruff I001 import block unsorted error
- ruff UP015 unnecessary mode argument error
- behave AmbiguousStep duplicate step definition error
This commit is contained in:
2026-04-14 22:40:11 +00:00
parent 1aa0c2a499
commit b3547e7692
@@ -2,7 +2,8 @@
from pathlib import Path
from typing import Any
from behave import given, when, then
from behave import given, then, when
@given('the specification file exists at "{filepath}"')
@@ -17,26 +18,10 @@ def step_specification_file_exists(context: Any, filepath: str) -> None:
def step_read_specification_file(context: Any) -> None:
"""Read the specification file content."""
spec_path = getattr(context, "spec_path", Path("docs/specification.md"))
with open(spec_path, "r", encoding="utf-8") as f:
with open(spec_path, encoding="utf-8") as f:
context.spec_content = f.read()
@then('the content should contain "{text}"')
def step_content_contains(context: Any, text: str) -> None:
"""Verify the specification contains the given text."""
assert hasattr(context, "spec_content"), "Specification content not loaded"
assert text in context.spec_content, f"Text not found in specification: {text}"
@then('the content should NOT contain "{text}"')
def step_content_not_contains(context: Any, text: str) -> None:
"""Verify the specification does not contain the given text."""
assert hasattr(context, "spec_content"), "Specification content not loaded"
assert text not in context.spec_content, (
f"Text should not be in specification: {text}"
)
@then('the content should contain a table with milestone "{milestone}"')
def step_content_contains_milestone_in_table(context: Any, milestone: str) -> None:
"""Verify the specification contains a milestone in a table."""
@@ -48,6 +33,15 @@ def step_content_contains_milestone_in_table(context: Any, milestone: str) -> No
)
@then('the content should NOT contain "{text}"')
def step_content_not_contains(context: Any, text: str) -> None:
"""Verify the specification does not contain the given text."""
assert hasattr(context, "spec_content"), "Specification content not loaded"
assert text not in context.spec_content, (
f"Text should not be in specification: {text}"
)
@then('the content should contain "{text}" in the milestone status')
def step_content_contains_in_milestone_status(context: Any, text: str) -> None:
"""Verify the specification contains text in the milestone status section."""