-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #549 from deepmind/release-v0.28.1-rc.1
Start release v0.28.1-rc.1
- Loading branch information
Showing
3 changed files
with
47 additions
and
5 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
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 |
---|---|---|
|
@@ -44,7 +44,47 @@ def setUp(self): | |
|
||
def test_cli_secret_reveal_tag(self): | ||
""" | ||
run $ kapitan refs - -write gpg: test_secretb64 - -base64 | ||
run $ kapitan refs --write gpg: test_secret | ||
and run $ kapitan refs --reveal --tag "?{gpg:test_secret}" | ||
with [email protected] recipient | ||
""" | ||
test_secret_content = "I am another secret!" | ||
test_secret_file = tempfile.mktemp() | ||
with open(test_secret_file, "w") as fp: | ||
fp.write(test_secret_content) | ||
|
||
sys.argv = [ | ||
"kapitan", | ||
"refs", | ||
"--write", | ||
"gpg:test_secret", | ||
"-f", | ||
test_secret_file, | ||
"--refs-path", | ||
REFS_PATH, | ||
"--recipients", | ||
"[email protected]", | ||
] | ||
main() | ||
|
||
test_tag_content = "?{gpg:test_secret}" | ||
test_tag_file = tempfile.mktemp() | ||
with open(test_tag_file, "w") as fp: | ||
fp.write(test_tag_content) | ||
sys.argv = ["kapitan", "refs", "--reveal", "--tag", test_tag_content, "--refs-path", REFS_PATH] | ||
|
||
# set stdout as string | ||
stdout = io.StringIO() | ||
with contextlib.redirect_stdout(stdout): | ||
main() | ||
stdout = stdout.getvalue() | ||
self.assertEqual(test_secret_content, stdout) | ||
|
||
os.remove(test_tag_file) | ||
|
||
def test_cli_secret_reveal_b64_tag(self): | ||
""" | ||
run $ kapitan refs --write gpg: test_secretb64 --base64 | ||
and run $ kapitan refs --reveal --tag "?{gpg:test_secretb64}" | ||
with [email protected] recipient | ||
""" | ||
|