-
Notifications
You must be signed in to change notification settings - Fork 26
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 #1502 from asmacdo/uri-scheme-rendering-2
Fixup URI scheme rendering in --help output
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
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,22 @@ | ||
import subprocess | ||
|
||
|
||
def get_helptext(command): | ||
result = subprocess.run( | ||
[*command, '--help'], | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
text=True | ||
) | ||
return result.stdout | ||
|
||
|
||
def test_resource_identifier_helptext(): | ||
# The \n chars must be included for correct rendering | ||
correct = "Accepted resource identifier patterns:\n - DANDI:<dandiset id>[/<version>]\n" | ||
|
||
ls_helptext = get_helptext(['dandi', 'ls']) | ||
assert correct in ls_helptext | ||
|
||
download_helptext = get_helptext(['dandi', 'download']) | ||
assert correct in download_helptext |