Test the encrypt method with mocked values.
(self, mock_encrypt)
| 51 | |
| 52 | @mock.patch("XOR_cipher.XORCipher.encrypt") |
| 53 | def test_encrypt(self, mock_encrypt): |
| 54 | """ |
| 55 | Test the encrypt method with mocked values. |
| 56 | """ |
| 57 | |
| 58 | ans = mock.MagicMock() |
| 59 | content = mock.MagicMock() |
| 60 | key = mock.MagicMock() |
| 61 | XORCipher.encrypt = mock.MagicMock(return_value=ans) |
| 62 | XORCipher.encrypt(content, key) |
| 63 | |
| 64 | XORCipher.encrypt.assert_called_with(content, key) |
| 65 | |
| 66 | @mock.patch("XOR_cipher.XORCipher.decrypt") |
| 67 | def test_decrypt(self, mock_decrypt): |