예제 #1
0
    def test_decrypt_file(self, mock_decrypt_file):
        """
        Test the decrypt_file method with mocked values.
        """

        file = mock.MagicMock()
        key = mock.MagicMock()
        XORCipher.decrypt_string = mock.MagicMock(return_value=True)
        XORCipher.decrypt_string(file, key)

        XORCipher.decrypt_string.assert_called_with(file, key)
예제 #2
0
    def test_decrypt_string(self, mock_decrypt_string):
        """
        Test the decrypt_string method with mocked values.
        """

        ans = mock.MagicMock()
        content = mock.MagicMock()
        key = mock.MagicMock()
        XORCipher.decrypt_string = mock.MagicMock(return_value=ans)
        XORCipher.decrypt_string(content, key)

        XORCipher.decrypt_string.assert_called_with(content, key)