2023-04-04 09:40:52 +00:00
|
|
|
Index: ZEO-5.4.0/src/ZEO/tests/testZEO.py
|
2021-09-24 21:21:32 +00:00
|
|
|
===================================================================
|
2023-04-04 09:40:52 +00:00
|
|
|
--- ZEO-5.4.0.orig/src/ZEO/tests/testZEO.py
|
|
|
|
|
+++ ZEO-5.4.0/src/ZEO/tests/testZEO.py
|
|
|
|
|
@@ -83,7 +83,10 @@ class CreativeGetState(persistent.Persis
|
2021-09-24 21:21:32 +00:00
|
|
|
class Test_convenience_functions(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
def test_ZEO_client_convenience(self):
|
|
|
|
|
- import mock
|
|
|
|
|
+ try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+ except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
import ZEO
|
|
|
|
|
|
|
|
|
|
client_thread = mock.Mock(
|
2023-04-04 09:40:52 +00:00
|
|
|
@@ -95,7 +98,10 @@ class Test_convenience_functions(unittes
|
|
|
|
|
client._cache.close() # client thread responsibility
|
2021-09-24 21:21:32 +00:00
|
|
|
|
|
|
|
|
def test_ZEO_DB_convenience_ok(self):
|
|
|
|
|
- import mock
|
|
|
|
|
+ try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+ except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
import ZEO
|
|
|
|
|
|
|
|
|
|
client_mock = mock.Mock(spec=['close'])
|
2023-04-04 09:40:52 +00:00
|
|
|
@@ -113,7 +119,10 @@ class Test_convenience_functions(unittes
|
2021-09-24 21:21:32 +00:00
|
|
|
client_mock.close.assert_not_called()
|
|
|
|
|
|
|
|
|
|
def test_ZEO_DB_convenience_error(self):
|
|
|
|
|
- import mock
|
|
|
|
|
+ try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+ except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
import ZEO
|
|
|
|
|
|
|
|
|
|
client_mock = mock.Mock(spec=['close'])
|
2023-04-04 09:40:52 +00:00
|
|
|
@@ -131,7 +140,10 @@ class Test_convenience_functions(unittes
|
2021-09-24 21:21:32 +00:00
|
|
|
client_mock.close.assert_called_once()
|
|
|
|
|
|
|
|
|
|
def test_ZEO_connection_convenience_ok(self):
|
|
|
|
|
- import mock
|
|
|
|
|
+ try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+ except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
import ZEO
|
|
|
|
|
|
|
|
|
|
ret = object()
|
2023-04-04 09:40:52 +00:00
|
|
|
@@ -150,7 +162,10 @@ class Test_convenience_functions(unittes
|
2021-09-24 21:21:32 +00:00
|
|
|
DB_mock.close.assert_not_called()
|
|
|
|
|
|
|
|
|
|
def test_ZEO_connection_convenience_value(self):
|
|
|
|
|
- import mock
|
|
|
|
|
+ try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+ except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
import ZEO
|
|
|
|
|
|
|
|
|
|
DB_mock = mock.Mock(spec=[
|
2023-04-04 09:40:52 +00:00
|
|
|
Index: ZEO-5.4.0/src/ZEO/tests/testZEOServer.py
|
2021-09-24 21:21:32 +00:00
|
|
|
===================================================================
|
2023-04-04 09:40:52 +00:00
|
|
|
--- ZEO-5.4.0.orig/src/ZEO/tests/testZEOServer.py
|
|
|
|
|
+++ ZEO-5.4.0/src/ZEO/tests/testZEOServer.py
|
2021-09-24 21:21:32 +00:00
|
|
|
@@ -1,6 +1,9 @@
|
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
-import mock
|
|
|
|
|
+try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
|
|
|
|
|
from ZEO._compat import PY3
|
2023-04-04 09:40:52 +00:00
|
|
|
from ZEO.runzeo import ZEOServer
|
|
|
|
|
Index: ZEO-5.4.0/src/ZEO/tests/testssl.py
|
2021-09-24 21:21:32 +00:00
|
|
|
===================================================================
|
2023-04-04 09:40:52 +00:00
|
|
|
--- ZEO-5.4.0.orig/src/ZEO/tests/testssl.py
|
|
|
|
|
+++ ZEO-5.4.0/src/ZEO/tests/testssl.py
|
2021-09-24 21:21:32 +00:00
|
|
|
@@ -1,9 +1,12 @@
|
|
|
|
|
from .._compat import PY3
|
|
|
|
|
|
|
|
|
|
-import mock
|
|
|
|
|
import os
|
|
|
|
|
import ssl
|
|
|
|
|
import unittest
|
|
|
|
|
+try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
from ZODB.config import storageFromString
|
|
|
|
|
|
|
|
|
|
from ..Exceptions import ClientDisconnected
|
2023-04-04 09:40:52 +00:00
|
|
|
Index: ZEO-5.4.0/src/ZEO/asyncio/tests.py
|
2021-09-24 21:21:32 +00:00
|
|
|
===================================================================
|
2023-04-04 09:40:52 +00:00
|
|
|
--- ZEO-5.4.0.orig/src/ZEO/asyncio/tests.py
|
|
|
|
|
+++ ZEO-5.4.0/src/ZEO/asyncio/tests.py
|
|
|
|
|
@@ -12,7 +12,10 @@ else:
|
2021-09-24 21:21:32 +00:00
|
|
|
|
|
|
|
|
from zope.testing import setupstack
|
2023-04-04 09:40:52 +00:00
|
|
|
from unittest import TestCase
|
2021-09-24 21:21:32 +00:00
|
|
|
-import mock
|
|
|
|
|
+try:
|
|
|
|
|
+ from unittest import mock as mock
|
|
|
|
|
+except ImportError:
|
|
|
|
|
+ import mock
|
|
|
|
|
from ZODB.utils import maxtid, RLock
|
|
|
|
|
|
2023-04-04 09:40:52 +00:00
|
|
|
import collections
|