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

Method test_decrypt_string

XORcipher/test_XOR_cipher.py:95–106  ·  view source on GitHub ↗

Test the decrypt_string method with mocked values.

(self, mock_decrypt_string)

Source from the content-addressed store, hash-verified

93
94 @mock.patch("XOR_cipher.XORCipher.decrypt_string")
95 def test_decrypt_string(self, mock_decrypt_string):
96 """
97 Test the decrypt_string method with mocked values.
98 """
99
100 ans = mock.MagicMock()
101 content = mock.MagicMock()
102 key = mock.MagicMock()
103 XORCipher.decrypt_string = mock.MagicMock(return_value=ans)
104 XORCipher.decrypt_string(content, key)
105
106 XORCipher.decrypt_string.assert_called_with(content, key)
107
108 @mock.patch("XOR_cipher.XORCipher.encrypt_file")
109 def test_encrypt_file(self, mock_encrypt_file):

Callers

nothing calls this directly

Calls 1

decrypt_stringMethod · 0.80

Tested by

no test coverage detected