Test the decrypt method with mocked values.
(self, mock_decrypt)
| 65 | |
| 66 | @mock.patch("XOR_cipher.XORCipher.decrypt") |
| 67 | def test_decrypt(self, mock_decrypt): |
| 68 | """ |
| 69 | Test the decrypt method with mocked values. |
| 70 | """ |
| 71 | |
| 72 | ans = mock.MagicMock() |
| 73 | content = mock.MagicMock() |
| 74 | key = mock.MagicMock() |
| 75 | XORCipher.decrypt = mock.MagicMock(return_value=ans) |
| 76 | XORCipher.decrypt(content, key) |
| 77 | |
| 78 | XORCipher.decrypt.assert_called_with(content, key) |
| 79 | |
| 80 | @mock.patch("XOR_cipher.XORCipher.encrypt_string") |
| 81 | def test_encrypt_string(self, mock_encrypt_string): |