Skip to content

Commit

Permalink
Move mock.py to neo/tests to not conflict with https://pypi.python.or…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuchemb committed Jan 13, 2017
1 parent 3e5299c commit 358da25
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
/build/
/dist/
/htmlcov/
/mock.py
/neo/tests/mock.py
/neoppod.egg-info/
2 changes: 1 addition & 1 deletion neo/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import transaction

from functools import wraps
from mock import Mock
from .mock import Mock
from neo.lib import debug, logging, protocol
from neo.lib.protocol import NodeTypes, Packets, UUID_NAMESPACES
from neo.lib.util import cached_property
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/client/testClientApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from ZODB.POSException import StorageTransactionError, ConflictError
from .. import NeoUnitTestBase, buildUrlFromString
from neo.client.app import Application
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/client/testConnectionPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import time, unittest
from mock import Mock
from ..mock import Mock

from .. import NeoUnitTestBase
from neo.client.app import ConnectionPool
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/client/testMasterHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from .. import NeoUnitTestBase
from neo.client.handlers.master import PrimaryAnswersHandler
from neo.client.exception import NEOStorageError
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/master/testClientHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from .. import NeoUnitTestBase
from neo.lib.util import p64
from neo.lib.protocol import NodeTypes, NodeStates, Packets
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/master/testElectionHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from neo.lib import protocol
from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates, Packets
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/master/testStorageHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, Packets
from neo.master.handlers.storage import StorageServiceHandler
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/master/testTransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from struct import pack
from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/storage/testClientHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock, ReturnValues
from ..mock import Mock, ReturnValues
from .. import NeoUnitTestBase
from neo.storage.app import Application
from neo.storage.handlers.client import ClientOperationHandler
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/storage/testMasterHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from collections import deque
from .. import NeoUnitTestBase
from neo.storage.app import Application
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/storage/testStorageApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from .. import NeoUnitTestBase
from neo.storage.app import Application
from neo.lib.protocol import CellStates
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/storage/testStorageMySQL.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import unittest
from MySQLdb import OperationalError
from mock import Mock
from ..mock import Mock
from neo.lib.exception import DatabaseFailure
from neo.lib.util import p64
from .. import DB_PREFIX, DB_SOCKET, DB_USER
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/storage/testTransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from ..mock import Mock
from .. import NeoUnitTestBase
from neo.lib.util import p64
from neo.storage.transactions import TransactionManager
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/testConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from time import time
from mock import Mock
from .mock import Mock
from neo.lib import connection, logging
from neo.lib.connection import BaseConnection, ClientConnection, \
MTClientConnection, CRITICAL_TIMEOUT
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/testHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import unittest
from mock import Mock
from .mock import Mock
from . import NeoUnitTestBase
from neo.lib.handler import EventHandler
from neo.lib.protocol import PacketMalformedError, UnexpectedPacketError, \
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/testNodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import shutil
import unittest
from mock import Mock
from .mock import Mock
from neo.lib.protocol import NodeTypes, NodeStates
from neo.lib.node import Node, MasterDB
from . import NeoUnitTestBase, getTempDirectory
Expand Down
2 changes: 1 addition & 1 deletion neo/tests/threaded/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from functools import partial, wraps
from thread import get_ident
from zlib import decompress
from mock import Mock
from ..mock import Mock
import transaction, ZODB
import neo.admin.app, neo.master.app, neo.storage.app
import neo.client.app, neo.neoctl.app
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
Topic :: Software Development :: Libraries :: Python Modules
"""

if not os.path.exists('mock.py'):
mock = 'neo/tests/mock.py'
if not os.path.exists(mock):
import cStringIO, hashlib,subprocess, urllib, zipfile
x = 'pythonmock-0.1.0.zip'
try:
Expand All @@ -25,7 +26,7 @@
mock_py = zipfile.ZipFile(cStringIO.StringIO(x)).read('mock.py')
if hashlib.md5(mock_py).hexdigest() != '79f42f390678e5195d9ce4ae43bd18ec':
raise EnvironmentError("MD5 checksum mismatch downloading 'mock.py'")
open('mock.py', 'w').write(mock_py)
open(mock, 'w').write(mock_py)

zodb_require = ['ZODB3>=3.10dev']

Expand Down Expand Up @@ -69,7 +70,6 @@ def get_long_description(self):
long_description = ".. contents::\n\n" + open('README.rst').read()
+ "\n" + open('CHANGELOG.rst').read(),
packages = find_packages(),
py_modules = ['mock'],
entry_points = {
'console_scripts': [
# XXX: we'd like not to generate scripts for unwanted features
Expand Down

0 comments on commit 358da25

Please sign in to comment.