forked from HAL9000/cleveragents-core
8ea00f5185
Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me> Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
48 lines
2.3 KiB
Gherkin
48 lines
2.3 KiB
Gherkin
Feature: NamespacedName validation
|
|
Verify that NamespacedName enforces spec-required naming rules:
|
|
namespace and name components must start with a letter (not a digit).
|
|
|
|
# ---------------------------------------------------------------
|
|
# TDD for issue #2145/#2147: Names must start with a letter
|
|
# ---------------------------------------------------------------
|
|
|
|
# @tdd_issue @tdd_issue_2145 @tdd_issue_2147 @tdd_expected_fail @skip
|
|
@skip
|
|
Scenario: NamespacedName.parse() rejects namespace starting with a digit
|
|
When I parse the namespaced name "123abc/my-action" expecting an error
|
|
Then a ValueError should be raised
|
|
And the error message should contain "must start with a letter"
|
|
|
|
# @tdd_issue @tdd_issue_2145 @tdd_issue_2147 @tdd_expected_fail @skip
|
|
@skip
|
|
Scenario: NamespacedName constructor rejects name starting with a digit
|
|
When I construct a NamespacedName with namespace "local" and name "123-action" expecting an error
|
|
Then a ValidationError should be raised
|
|
And the error message should contain "must start with a letter"
|
|
|
|
# @tdd_issue @tdd_issue_2145 @tdd_issue_2147 @tdd_expected_fail @skip
|
|
@skip
|
|
Scenario: NamespacedName constructor rejects namespace starting with a digit
|
|
When I construct a NamespacedName with namespace "999org" and name "valid-name" expecting an error
|
|
Then a ValidationError should be raised
|
|
And the error message should contain "must start with a letter"
|
|
|
|
# ---------------------------------------------------------------
|
|
# Positive cases: Valid names (start with letter)
|
|
# ---------------------------------------------------------------
|
|
|
|
Scenario: NamespacedName.parse() accepts namespace starting with a letter
|
|
When I parse the namespaced name "abc123/my-action"
|
|
Then the parsed namespace should be "abc123"
|
|
And the parsed item name should be "my-action"
|
|
|
|
Scenario: NamespacedName.parse() accepts name starting with a letter
|
|
When I parse the namespaced name "local/a123-action"
|
|
Then the parsed namespace should be "local"
|
|
And the parsed item name should be "a123-action"
|
|
|
|
Scenario: NamespacedName constructor accepts valid kebab-case names
|
|
Given I have a namespaced name with namespace "my-org" and name "my-action"
|
|
Then the parsed namespace should be "my-org"
|
|
And the parsed item name should be "my-action"
|