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

Method test_encrypt

XORcipher/test_XOR_cipher.py:53–64  ·  view source on GitHub ↗

Test the encrypt method with mocked values.

(self, mock_encrypt)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

encryptMethod · 0.80

Tested by

no test coverage detected