Exemplo n.º 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)
Exemplo n.º 2
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 -salt  > my_out')
     self.assertTrue(stdout_mock.write.called)
Exemplo n.º 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')
Exemplo n.º 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()
Exemplo n.º 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")
Exemplo n.º 6
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  > my_out')
Exemplo n.º 7
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()
Exemplo n.º 8
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 -salt -k 'xx' > my_out")