-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔨 Update the pytest environment and add various fix
- Loading branch information
1 parent
e2210cc
commit 59a2b92
Showing
10 changed files
with
168 additions
and
123 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 was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 +1,16 @@ | ||
import inspect | ||
import os | ||
import pytest | ||
import unittest | ||
|
||
current_dir: str = "./" | ||
if os.getenv('ENV') == "docker": | ||
|
||
current_dir: str = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | ||
if os.environ['HOME'] == "/app": | ||
current_dir = "/app/tests" | ||
else: | ||
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | ||
script: str = os.path.abspath(f"{current_dir}/../toolbox.sh") | ||
|
||
script: str = os.path.abspath(f"{current_dir}/../toolbox.sh") | ||
|
||
def test_function_not_exist(bash): | ||
with bash() as s: | ||
s.auto_return_code_error = False | ||
assert s.run_script(script, ['test_function']) == "Function with name test_function does not exist" | ||
assert s.last_return_code == 1 | ||
def test_function_not_exist(shell): | ||
ret = shell.run(script, "test_function") | ||
assert ret.returncode == 1 | ||
assert "Function with name test_function does not exist" in ret.stderr |
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
Oops, something went wrong.