Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for empty eyaml values #321

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion features/edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Feature: eyaml editing
When I run `eyaml edit non-existant-file.eyaml`
When I run `eyaml decrypt -e non-existant-file.eyaml`
Then the output should not match /#| This is eyaml edit mode/
And the output should match /new_key0: DEC::PKCS7\[\]\!/
And the output should match /new_key1: DEC::PKCS7\[new value one\]\!/
And the output should match /new_key2: DEC::PKCS7\[new value two\]\!/

Expand Down Expand Up @@ -99,6 +100,7 @@ Feature: eyaml editing
When I run `eyaml edit test_input.eyaml`
When I run `eyaml decrypt -e test_input.eyaml`
Then the output should match /encrypted_string: DEC::PKCS7\[planet of the apes\]\!/
And the output should match /new_key0: DEC::PKCS7\[\]\!/
And the output should match /new_key1: DEC::PKCS7\[new value one\]\!/
And the output should match /new_key2: DEC::PKCS7\[new value two\]\!/
And the output should match /multi_encryption: DEC::PLAINTEXT\[jammy\]\! DEC::PKCS7\[dodger\]!/
Expand Down Expand Up @@ -146,7 +148,8 @@ Feature: eyaml editing
When I run `bash -c 'cp test_edit.yaml test_edit.eyaml'`
When I run `eyaml edit -d test_edit.eyaml`
When I run `eyaml decrypt -e test_edit.eyaml`
Then the output should match /new_key1: DEC::PKCS7\[new value one\]\!/
Then the output should match /new_key0: DEC::PKCS7\[\]\!/
And the output should match /new_key1: DEC::PKCS7\[new value one\]\!/
And the output should match /new_key2: DEC::PKCS7\[new value two\]\!/

Scenario: no-decrypt mode should not modify existing values
Expand Down
1 change: 1 addition & 0 deletions features/sandbox/test_new_values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
new_key0: DEC::PKCS7[]!
new_key1: DEC::PKCS7[new value one]!
new_key2: DEC::PKCS7[new value two]!