Compare commits

...

1 Commits

3 changed files with 0 additions and 34 deletions
@@ -99,12 +99,6 @@ Feature: Repository uncovered branches and lines
When repo branch cov I attach validation "local/check-lint" to resource "res-1"
Then repo branch cov the attachment is returned with correct fields
Scenario: repo branch cov validation attach with swapped args auto-corrects
Given repo branch cov an in-memory database with tool tables
And repo branch cov a validation tool "local/check-fmt" exists
When repo branch cov I attach with validation_name "res/123" and resource_id "local/check-fmt"
Then repo branch cov the attachment swaps them correctly
# ── AutomationProfileRepository schema version mismatch ────
Scenario: repo branch cov upsert profile with schema version mismatch
@@ -410,31 +410,6 @@ def step_assert_attachment(context: Context):
assert att["mode"] == "required"
@when('repo branch cov I attach with validation_name "{vn}" and resource_id "{rid}"')
def step_attach_swapped(context: Context, vn: str, rid: str):
"""The validation_name contains '/' but resource_id doesn't (or vice versa)
so the repo auto-swaps them."""
repo = ValidationAttachmentRepository(
session_factory=context.rb_session_factory,
)
context.rb_result = repo.attach(
validation_name=vn,
resource_id=rid,
)
session = context.rb_session_factory()
session.commit()
@then("repo branch cov the attachment swaps them correctly")
def step_assert_swapped(context: Context):
att = context.rb_result
# "res/123" has "/" and "local/check-fmt" has "/" too, but the swap
# logic checks: "/" in resource_id AND "/" not in validation_name
# With both having "/", no swap happens. Let's just verify it stored.
assert isinstance(att, dict)
assert "attachment_id" in att
# ── AutomationProfileRepository: upsert schema mismatch ────────
@@ -3916,9 +3916,6 @@ class ValidationAttachmentRepository:
from ulid import ULID as _ULID
if "/" in resource_id and "/" not in validation_name:
validation_name, resource_id = resource_id, validation_name
session = self._session()
try:
# Check for existing attachment with same validation+resource+scope