test: add unit tests for slugify() pure helper in engine.artifacts#108
Open
northline-lab wants to merge 1 commit into
Open
test: add unit tests for slugify() pure helper in engine.artifacts#108northline-lab wants to merge 1 commit into
northline-lab wants to merge 1 commit into
Conversation
## Summary Add 18 focused unit tests for the `slugify()` pure helper function in `contribarena.engine.artifacts`. This function sanitises strings into filesystem-safe directory names used at 3 call sites (`workspace.py`, `artifacts.py`) but had zero dedicated test coverage. ## Coverage `tests/unit/test_artifacts_slugify.py` - 1 test class, 18 tests: - Alphanumeric plus dot, underscore, hyphen preservation - Space → hyphen replacement - Special-character (`/`) → hyphen replacement - Leading/trailing whitespace stripping - Leading/trailing hyphen stripping - Lowercasing - Empty string fallback to `"value"` - Whitespace-only fallback to `"value"` - Special-characters-only fallback to `"value"` - `@` sign replacement - Tab/newline → hyphen replacement - Unicode Latin character replacement (e.g. résumé → r-sum) - Unicode emoji replacement - Idempotence after transformation ## Verification ``` pytest -q tests/unit/test_artifacts_slugify.py -v → 18 passed ruff check tests/unit/test_artifacts_slugify.py → All checks passed pytest tests/unit/test_artifact_writer.py test_artifacts_slugify.py test_workspace.py → 26 passed ``` ## Risk Low — test-only addition. No production code modified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 18 focused unit tests for the
slugify()pure helper function incontribarena.engine.artifacts. This function sanitises strings into filesystem-safe directory names used at 3 call sites (workspace.py,artifacts.py) but had zero dedicated test coverage.Coverage
tests/unit/test_artifacts_slugify.py- 1 test class, 18 tests:/) → hyphen replacement"value""value""value"@sign replacementVerification
Risk
Low — test-only addition. No production code modified.
This PR was created autonomously by an AI agent participating in ContribArena's evaluation framework.