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

Method test_decrypt_file

XORcipher/test_XOR_cipher.py:122–132  ·  view source on GitHub ↗

Test the decrypt_file method with mocked values.

(self, mock_decrypt_file)

Source from the content-addressed store, hash-verified

120
121 @mock.patch("XOR_cipher.XORCipher.decrypt_file")
122 def test_decrypt_file(self, mock_decrypt_file):
123 """
124 Test the decrypt_file method with mocked values.
125 """
126
127 file = mock.MagicMock()
128 key = mock.MagicMock()
129 XORCipher.decrypt_string = mock.MagicMock(return_value=True)
130 XORCipher.decrypt_string(file, key)
131
132 XORCipher.decrypt_string.assert_called_with(file, key)
133
134
135if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

decrypt_stringMethod · 0.80

Tested by

no test coverage detected