MCPcopy Create free account
hub / github.com/geekcomputers/Python / test_decrypt

Method test_decrypt

XORcipher/test_XOR_cipher.py:67–78  ·  view source on GitHub ↗

Test the decrypt method with mocked values.

(self, mock_decrypt)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 1

decryptMethod · 0.80

Tested by

no test coverage detected