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

More tests #53

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

More tests #53

wants to merge 32 commits into from

Conversation

carolinedil
Copy link

@carolinedil carolinedil commented Jun 27, 2018

I've added a number of tests:

  • Added Helpers Test for create_or_overwrite_file.
  • Added Crypto Test for encrypt_file which gives the wrong key into encrypt and expects the Wrong Key error. (need to add one for decrypt)
  • Added Crypto Test for decrypt_file that checks if error is properly conveyed when trying to decrypt a file that has "already been decrypted" (Simply have a file that is not in encrypted form).
  • Added Crypto Test for encrypt_file that checks if error is properly conveyed when trying to encrypt a file that has "already been encrypted".
  • Added Crypto Test for read_file that checks if it works on files with content written to them (I choose a string: "something")
  • Added Crypto test for read_file that checks if it throws an error when used on an empty file.
  • Added Crypto test for _restore_from_backup that checks what is output when plaintext has been encrypted and the resultant cipher text is decrypted then plaintext is altered.
  • Added Crypto test for _restore_from_backup that checks if it works under conditions with no alteration to cipher text or plaintext before restoration.

Caroline DiLorenzo added 8 commits June 27, 2018 11:14
…ng to decrypt a file that has "already been decrypted" (Simply have a file that is not in encrypted form).
…ng to encrypt a file that has already been encrypted.
…n plaintext has been encrypted and the resultant cipher text is decrypted then plaintext is altered.
…ditions with no alteration to cipher text or plaintext before restoration.
@chrisdl chrisdl self-assigned this Jun 27, 2018
@chrisdl
Copy link
Contributor

chrisdl commented Jun 27, 2018

These tests don't work in all pythons we support yet, so let's work on this! Thanks for the PR!

Caroline DiLorenzo added 7 commits June 29, 2018 16:15
Used the b function from compat in order to fix the incompatabilities...
also fixed the missing runner
… It will test if changes to the ciphertext will still appear in the ciphertext after decrypting then reencrypting.

plaintext = "even write in it for the test" - encrypt -> ciphertext == """- - - Encrypted by jak - - - ......." - append to ciphertext "Something" -> - decrypt file -> plaintext = "even write in it for the test" - reencrypt -> ciphertext == """- - - Encrypted by jak - - - ....... Something"
@carolinedil
Copy link
Author

See if it works now with the changes I've made. I've tested on my computer with both workon py27 and workon py36.

Caroline DiLorenzo and others added 11 commits July 2, 2018 12:27
…This can be changed by getting rid of the "--cov-report term-missing " part of the line I changed.
test_read_jakfile_standard_format will check if read_jakfile works as intended under regular circumstances. It is possible to make it more extensively specific, however I didn't feel that was needed
test_read_jakefile_malformed  will check if read_jakfile will return an error when the jakfile doesn't fit the format it ought to. I didn't know how to do it other than having the actual jakfile altered and then to return it to the form it was before (then if that doesn't work set it to how it would be when creating a new jakfile.
This test gives coverage to the error that hadn't been tested of missing key error within _select_files_logic
…e coverage.

This checks that when requesting a keyfile that doesn't exist, an error will be returned that that keyfile doesn't exist.
…I added a create jakfile at the beginning of decorators in the hopes it would fix the problem of no jakfile for all the other tests in that file too.
Caroline DiLorenzo added 6 commits July 3, 2018 14:05
…d something so that we write to the file and then check that the regular jakfile stays the same and our test one changes.
… check if the mock file was properly accessed, but the jakfile wasn't altered
Also parametrization and crypto cleaned up a bit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants