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

Method test_encrypt_string

XORcipher/test_XOR_cipher.py:81–92  ·  view source on GitHub ↗

Test the encrypt_string method with mocked values.

(self, mock_encrypt_string)

Source from the content-addressed store, hash-verified

79
80 @mock.patch("XOR_cipher.XORCipher.encrypt_string")
81 def test_encrypt_string(self, mock_encrypt_string):
82 """
83 Test the encrypt_string method with mocked values.
84 """
85
86 ans = mock.MagicMock()
87 content = mock.MagicMock()
88 key = mock.MagicMock()
89 XORCipher.encrypt_string = mock.MagicMock(return_value=ans)
90 XORCipher.encrypt_string(content, key)
91
92 XORCipher.encrypt_string.assert_called_with(content, key)
93
94 @mock.patch("XOR_cipher.XORCipher.decrypt_string")
95 def test_decrypt_string(self, mock_decrypt_string):

Callers

nothing calls this directly

Calls 1

encrypt_stringMethod · 0.80

Tested by

no test coverage detected