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

Method test__init__

XORcipher/test_XOR_cipher.py:37–50  ·  view source on GitHub ↗

Test the __init__ method with commented values in the event one needs to instantiate mocked objects on the method.

(self, mock__init__)

Source from the content-addressed store, hash-verified

35
36 @mock.patch("XOR_cipher.XORCipher.__init__")
37 def test__init__(self, mock__init__):
38 """
39 Test the __init__ method with commented values in the event
40 one needs to instantiate mocked objects on the method.
41 """
42
43 # self.XORCipher_1.__init__ = mock.MagicMock()
44 XORCipher.__init__ = mock.MagicMock()
45
46 # self.XORCipher_1.__init__(1)
47 XORCipher.__init__()
48
49 # self.XORCipher_1.__init__.assert_called_with(1)
50 XORCipher.__init__.assert_called()
51
52 @mock.patch("XOR_cipher.XORCipher.encrypt")
53 def test_encrypt(self, mock_encrypt):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected