-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pytest | ||
Check notice Code scanning / CodeQL Unused import Note test
Import of 'pytest' is not used.
|
||
|
||
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 |