-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No more full summary if link count zero
- Loading branch information
1 parent
ce4f416
commit a7ae342
Showing
2 changed files
with
38 additions
and
17 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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
import os | ||
import subprocess | ||
|
||
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
|
||
def test_linkstatus_command(): | ||
return_code = os.system("linkstatus") | ||
assert return_code == 0 | ||
result = subprocess.run("linkstatus", stdout=subprocess.PIPE) | ||
assert result.returncode == 1 | ||
assert "Source Not Found" in result.stdout.decode() | ||
assert "Run 'linkstatus --help' for more information." in result.stdout.decode() | ||
|
||
|
||
def test_linkstatus_command_with_source(): | ||
src = os.path.join(BASE_DIR, "conftest.py") | ||
result = subprocess.run(["linkstatus", src], stdout=subprocess.PIPE) | ||
assert result.returncode == 0 | ||
assert result.stdout.decode().strip() == "No link found" |