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

Method test_encrypt_file

XORcipher/test_XOR_cipher.py:109–119  ·  view source on GitHub ↗

Test the encrypt_file method with mocked values.

(self, mock_encrypt_file)

Source from the content-addressed store, hash-verified

107
108 @mock.patch("XOR_cipher.XORCipher.encrypt_file")
109 def test_encrypt_file(self, mock_encrypt_file):
110 """
111 Test the encrypt_file method with mocked values.
112 """
113
114 file = mock.MagicMock()
115 key = mock.MagicMock()
116 XORCipher.encrypt_file = mock.MagicMock(return_value=True)
117 XORCipher.encrypt_file(file, key)
118
119 XORCipher.encrypt_file.assert_called_with(file, key)
120
121 @mock.patch("XOR_cipher.XORCipher.decrypt_file")
122 def test_decrypt_file(self, mock_decrypt_file):

Callers

nothing calls this directly

Calls 1

encrypt_fileMethod · 0.80

Tested by

no test coverage detected