-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #1. ### Summary of Changes Test the command line interface with `pytest`. --------- Co-authored-by: lars-reimann <[email protected]>
- Loading branch information
1 parent
defcc93
commit 0062000
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
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,95 @@ | ||
import subprocess | ||
|
||
|
||
def test_cli_api() -> None: | ||
subprocess.run( | ||
[ | ||
"poetry", | ||
"run", | ||
"analyze-library", | ||
"api", | ||
"-p", | ||
"library_analyzer", | ||
"-s", | ||
"src", | ||
"-o", | ||
"out", | ||
], | ||
check=True, | ||
) | ||
|
||
|
||
def test_cli_usages() -> None: | ||
subprocess.run( | ||
[ | ||
"poetry", | ||
"run", | ||
"analyze-library", | ||
"usages", | ||
"-p", | ||
"library_analyzer", | ||
"-c", | ||
"library_analyzer", | ||
"-o", | ||
"out", | ||
], | ||
check=True, | ||
) | ||
|
||
|
||
def test_cli_annotations() -> None: | ||
subprocess.run( | ||
[ | ||
"poetry", | ||
"run", | ||
"analyze-library", | ||
"annotations", | ||
"-a", | ||
"tests/data/removeAnnotations/api_data.json", | ||
"-u", | ||
"tests/data/removeAnnotations/usage_data.json", | ||
"-o", | ||
"out/annotations.json", | ||
], | ||
check=True, | ||
) | ||
|
||
|
||
def test_cli_all() -> None: | ||
subprocess.run( | ||
[ | ||
"poetry", | ||
"run", | ||
"analyze-library", | ||
"all", | ||
"-p", | ||
"library_analyzer", | ||
"-s", | ||
"src", | ||
"-c", | ||
"library_analyzer", | ||
"-o", | ||
"out", | ||
], | ||
check=True, | ||
) | ||
|
||
|
||
def test_cli_migration() -> None: | ||
subprocess.run( | ||
[ | ||
"poetry", | ||
"run", | ||
"analyze-library", | ||
"migrate", | ||
"-a1", | ||
"tests/data/migration/apiv1_data.json", | ||
"-a2", | ||
"tests/data/migration/apiv2_data.json", | ||
"-a", | ||
"tests/data/migration/annotationv1.json", | ||
"-o", | ||
"out", | ||
], | ||
check=True, | ||
) |