-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pytest: Add simple functional pytest
Signed-off-by: Arisu Tachibana <arisu.tachibana@miraclelinux.com>
- Loading branch information
1 parent
3e74d19
commit 1e5c235
Showing
2 changed files
with
42 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
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,40 @@ | ||
import os | ||
from subprocess import PIPE, run | ||
|
||
|
||
def test_prepare(): | ||
os.system("cp .kci-dev.toml.example .kci-dev.toml") | ||
assert os.path.exists(".kci-dev.toml") | ||
|
||
|
||
def test_kcidev_help(): | ||
command = ["poetry", "run", "kci-dev", "--help"] | ||
result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) | ||
print("returncode: " + str(result.returncode)) | ||
print("#### stdout ####") | ||
print(result.stdout) | ||
print("#### stderr ####") | ||
print(result.stderr) | ||
assert result.returncode == 0 | ||
|
||
|
||
def test_kcidev_commit_help(): | ||
command = ["poetry", "run", "kci-dev", "commit", "--help"] | ||
result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) | ||
print("returncode: " + str(result.returncode)) | ||
print("#### stdout ####") | ||
print(result.stdout) | ||
print("#### stderr ####") | ||
print(result.stderr) | ||
assert result.returncode == 0 | ||
|
||
|
||
def test_kcidev_patch_help(): | ||
command = ["poetry", "run", "kci-dev", "patch", "--help"] | ||
result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) | ||
print("returncode: " + str(result.returncode)) | ||
print("#### stdout ####") | ||
print(result.stdout) | ||
print("#### stderr ####") | ||
print(result.stderr) | ||
assert result.returncode == 0 |