Beispiel #1
0
 def test_proper_encrypt_verbose(
         self, isfile_mock, system_mock, stdout_mock):
     stdout_mock.write = MagicMock()
     isfile_mock.return_value = True
     main()
     system_mock.assert_called_with(
         'cat my_in | openssl enc -aes-256-cbc -pbkdf2 -salt  > my_out')
     self.assertTrue(stdout_mock.write.called)
 def test_proper_encrypt_verbose(self, isfile_mock, system_mock,
                                 stdout_mock):
     stdout_mock.write = MagicMock()
     isfile_mock.return_value = True
     main()
     system_mock.assert_called_with(
         'cat my_in | openssl enc -aes-256-cbc -salt  > my_out')
     self.assertTrue(stdout_mock.write.called)
Beispiel #3
0
 def test_proper_decrypt(self, isfile_mock, system_mock):
     isfile_mock.return_value = True
     main()
     system_mock.assert_called_with(
         'cat my_in | openssl enc -d -aes-256-cbc  -pbkdf2 > my_out')
Beispiel #4
0
 def test_proper_encypt_no_input_file(
         self, isfile_mock, stderr_mock, system_mock):
     isfile_mock.return_value = False
     with self.assertRaises(SystemExit):
         main()
Beispiel #5
0
 def test_proper_encypt_with_password(self, isfile_mock, system_mock):
     isfile_mock.return_value = True
     main()
     system_mock.assert_called_with(
         "cat my_in | openssl enc -aes-256-cbc -pbkdf2 -salt -k 'xx' > my_out")
 def test_proper_decrypt(self, isfile_mock, system_mock):
     isfile_mock.return_value = True
     main()
     system_mock.assert_called_with(
         'cat my_in | openssl enc -d -aes-256-cbc  > my_out')
 def test_proper_encypt_no_input_file(self, isfile_mock, stderr_mock,
                                      system_mock):
     isfile_mock.return_value = False
     with self.assertRaises(SystemExit):
         main()
 def test_proper_encypt_with_password(self, isfile_mock, system_mock):
     isfile_mock.return_value = True
     main()
     system_mock.assert_called_with(
         "cat my_in | openssl enc -aes-256-cbc -salt -k 'xx' > my_out")