-
Notifications
You must be signed in to change notification settings - Fork 1
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
4 changed files
with
63 additions
and
1 deletion.
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
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,43 @@ | ||
import re | ||
import sys | ||
from click.testing import CliRunner | ||
|
||
from seeqret.db_utils import debug_fetch_users, debug_secrets | ||
from seeqret.main import cli, user, users, init, list | ||
from seeqret.cli_group_add import key | ||
from tests.clirunner_utils import print_result | ||
|
||
from seeqret.main import cli, env | ||
from seeqret.migrations.utils import current_version | ||
|
||
|
||
def test_env(): | ||
runner = CliRunner(env=dict(TESTING="TRUE")) | ||
with runner.isolated_filesystem(): | ||
result = runner.invoke(init, [ | ||
'.', | ||
'--user=test', | ||
'[email protected]', | ||
]) | ||
if result.exit_code != 0: print_result(result) | ||
assert result.exit_code == 0 | ||
|
||
assert len(debug_secrets()) == 0 | ||
result = runner.invoke(list) | ||
assert result.exit_code == 0 | ||
|
||
result = runner.invoke(key, [ | ||
'FOO', 'BAR', | ||
'--app=myapp', | ||
'--env=dev' | ||
]) | ||
if result.exit_code != 0: print_result(result) | ||
|
||
with open('env.template', 'w') as f: | ||
f.write(':dev\n') | ||
result = runner.invoke(env) | ||
if result.exit_code != 0: print_result(result) | ||
|
||
assert result.exit_code == 0 | ||
assert 'FOO="BAR"' in open('.env').read() | ||
|
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,13 @@ | ||
import re | ||
import sys | ||
|
||
from click.testing import CliRunner | ||
from seeqret.main import cli, init, info | ||
from seeqret.migrations.utils import current_version | ||
|
||
|
||
def test_info(): | ||
runner = CliRunner(env=dict(TESTING="TRUE")) | ||
with runner.isolated_filesystem(): | ||
result = runner.invoke(info) | ||
assert result.exit_code == 0 |