-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1469 from dmach/tokens
Improve working with tokens
- Loading branch information
Showing
3 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Feature: `osc token` command | ||
|
||
|
||
Scenario: Run `osc token` with no arguments | ||
When I execute osc with args "token" | ||
Then stdout is | ||
""" | ||
<directory count="0"/> | ||
""" | ||
|
||
|
||
Scenario: Run `osc token --operation rebuild` | ||
When I execute osc with args "token --create --operation rebuild test:factory test-pkgA" | ||
Then stdout matches | ||
""" | ||
Create a new token | ||
<status code="ok"> | ||
<summary>Ok</summary> | ||
<data name="token">.*</data> | ||
<data name="id">1</data> | ||
</status> | ||
""" | ||
Given I execute osc with args "token" | ||
And stdout matches | ||
""" | ||
<directory count="1"> | ||
<entry id="1" string=".*" kind="rebuild" description="" triggered_at="" project="test:factory" package="test-pkgA"/> | ||
</directory> | ||
""" | ||
And I search 'string="(?P<token>[^"]+)' in stdout and store named groups in 'tokens' | ||
When I execute osc with args "token --trigger {context.tokens[0][token]}" | ||
Then stdout is | ||
""" | ||
Trigger token | ||
<status code="ok"> | ||
<summary>Ok</summary> | ||
</status> | ||
""" |
This file contains 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