Commit d9471e2e authored by Julien Muchembled's avatar Julien Muchembled

Use relative imports inside each virtual package

parent 0ad980c8
...@@ -21,7 +21,7 @@ from neo.lib.node import NodeManager ...@@ -21,7 +21,7 @@ from neo.lib.node import NodeManager
from neo.lib.event import EventManager from neo.lib.event import EventManager
from neo.lib.connection import ListeningConnection from neo.lib.connection import ListeningConnection
from neo.lib.exception import PrimaryFailure from neo.lib.exception import PrimaryFailure
from neo.admin.handler import AdminEventHandler, MasterEventHandler, \ from .handler import AdminEventHandler, MasterEventHandler, \
MasterRequestEventHandler MasterRequestEventHandler
from neo.lib.connector import getConnectorHandler from neo.lib.connector import getConnectorHandler
from neo.lib.bootstrap import BootstrapManager from neo.lib.bootstrap import BootstrapManager
......
...@@ -24,9 +24,8 @@ from functools import wraps ...@@ -24,9 +24,8 @@ from functools import wraps
from neo.lib import setupLog from neo.lib import setupLog
from neo.lib.util import add64 from neo.lib.util import add64
from neo.lib.protocol import ZERO_TID from neo.lib.protocol import ZERO_TID
from neo.client.app import Application from .app import Application
from neo.client.exception import NEOStorageNotFoundError from .exception import NEOStorageNotFoundError, NEOStorageDoesNotExistError
from neo.client.exception import NEOStorageDoesNotExistError
def check_read_only(func): def check_read_only(func):
def wrapped(self, *args, **kw): def wrapped(self, *args, **kw):
......
...@@ -36,19 +36,19 @@ from neo.lib.locking import Lock ...@@ -36,19 +36,19 @@ from neo.lib.locking import Lock
from neo.lib.connection import MTClientConnection, OnTimeout, ConnectionClosed from neo.lib.connection import MTClientConnection, OnTimeout, ConnectionClosed
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from neo.lib.connector import getConnectorHandler from neo.lib.connector import getConnectorHandler
from neo.client.exception import NEOStorageError, NEOStorageCreationUndoneError from .exception import NEOStorageError, NEOStorageCreationUndoneError
from neo.client.exception import NEOStorageNotFoundError from .exception import NEOStorageNotFoundError
from neo.lib.exception import NeoException from neo.lib.exception import NeoException
from neo.client.handlers import storage, master from .handlers import storage, master
from neo.lib.dispatcher import Dispatcher, ForgottenPacket from neo.lib.dispatcher import Dispatcher, ForgottenPacket
from neo.client.poll import ThreadedPoll, psThreadedPoll from .poll import ThreadedPoll, psThreadedPoll
from neo.client.iterator import Iterator from .iterator import Iterator
from neo.client.cache import ClientCache from .cache import ClientCache
from neo.client.pool import ConnectionPool from .pool import ConnectionPool
from neo.lib.util import u64, parseMasterList from neo.lib.util import u64, parseMasterList
from neo.lib.profiling import profiler_decorator, PROFILING_ENABLED from neo.lib.profiling import profiler_decorator, PROFILING_ENABLED
from neo.lib.debug import register as registerLiveDebugger from neo.lib.debug import register as registerLiveDebugger
from neo.client.container import ThreadContainer, TransactionContainer from .container import ThreadContainer, TransactionContainer
if PROFILING_ENABLED: if PROFILING_ENABLED:
# Those functions require a "real" python function wrapper before they can # Those functions require a "real" python function wrapper before they can
......
...@@ -20,7 +20,7 @@ from ZODB.config import BaseConfig ...@@ -20,7 +20,7 @@ from ZODB.config import BaseConfig
class NeoStorage(BaseConfig): class NeoStorage(BaseConfig):
def open(self): def open(self):
from neo.client.Storage import Storage from .Storage import Storage
config = self.config config = self.config
return Storage(**dict((k, getattr(config, k)) return Storage(**dict((k, getattr(config, k))
for k in config.getSectionAttributes())) for k in config.getSectionAttributes()))
...@@ -16,12 +16,11 @@ ...@@ -16,12 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import neo.lib import neo.lib
from neo.client.handlers import BaseHandler, AnswerBaseHandler
from neo.lib.pt import MTPartitionTable as PartitionTable from neo.lib.pt import MTPartitionTable as PartitionTable
from neo.lib.protocol import NodeTypes, NodeStates, ProtocolError from neo.lib.protocol import NodeTypes, NodeStates, ProtocolError
from neo.lib.util import dump from neo.lib.util import dump
from neo.client.exception import NEOStorageError from . import BaseHandler, AnswerBaseHandler
from ..exception import NEOStorageError
class PrimaryBootstrapHandler(AnswerBaseHandler): class PrimaryBootstrapHandler(AnswerBaseHandler):
""" Bootstrap handler used when looking for the primary master """ """ Bootstrap handler used when looking for the primary master """
......
...@@ -19,12 +19,12 @@ from ZODB.TimeStamp import TimeStamp ...@@ -19,12 +19,12 @@ from ZODB.TimeStamp import TimeStamp
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
import neo.lib import neo.lib
from neo.client.handlers import BaseHandler, AnswerBaseHandler
from neo.lib.protocol import NodeTypes, ProtocolError, LockState, ZERO_TID from neo.lib.protocol import NodeTypes, ProtocolError, LockState, ZERO_TID
from neo.lib.util import dump from neo.lib.util import dump
from neo.client.exception import NEOStorageError, NEOStorageNotFoundError
from neo.client.exception import NEOStorageDoesNotExistError
from neo.lib.exception import NodeNotReady from neo.lib.exception import NodeNotReady
from . import BaseHandler, AnswerBaseHandler
from ..exception import NEOStorageError, NEOStorageNotFoundError
from ..exception import NEOStorageDoesNotExistError
class StorageEventHandler(BaseHandler): class StorageEventHandler(BaseHandler):
......
...@@ -19,8 +19,7 @@ from ZODB import BaseStorage ...@@ -19,8 +19,7 @@ from ZODB import BaseStorage
from zope.interface import implements from zope.interface import implements
import ZODB.interfaces import ZODB.interfaces
from neo.lib.util import u64, add64 from neo.lib.util import u64, add64
from neo.client.exception import NEOStorageCreationUndoneError from .exception import NEOStorageCreationUndoneError, NEOStorageNotFoundError
from neo.client.exception import NEOStorageNotFoundError
CHUNK_LENGTH = 100 CHUNK_LENGTH = 100
......
...@@ -22,9 +22,9 @@ import neo.lib ...@@ -22,9 +22,9 @@ import neo.lib
from neo.lib.locking import RLock from neo.lib.locking import RLock
from neo.lib.protocol import NodeTypes, Packets from neo.lib.protocol import NodeTypes, Packets
from neo.lib.connection import MTClientConnection, ConnectionClosed from neo.lib.connection import MTClientConnection, ConnectionClosed
from neo.client.exception import NEOStorageError
from neo.lib.profiling import profiler_decorator from neo.lib.profiling import profiler_decorator
from neo.lib.exception import NodeNotReady from neo.lib.exception import NodeNotReady
from .exception import NEOStorageError
# How long before we might retry a connection to a node to which connection # How long before we might retry a connection to a node to which connection
# failed in the past. # failed in the past.
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
ATTRIBUTE_TRACKER_ENABLED = False ATTRIBUTE_TRACKER_ENABLED = False
from neo.lib.locking import LockUser from .locking import LockUser
""" """
Usage example: Usage example:
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
import neo import neo
from time import sleep from time import sleep
from neo.lib.handler import EventHandler from .handler import EventHandler
from neo.lib.protocol import Packets from .protocol import Packets
from neo.lib.util import dump from .util import dump
from neo.lib.connection import ClientConnection from .connection import ClientConnection
NO_SERVER = ('0.0.0.0', 0) NO_SERVER = ('0.0.0.0', 0)
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from ConfigParser import SafeConfigParser from ConfigParser import SafeConfigParser
from neo.lib import util from . import util
from neo.lib.util import parseNodeAddress from .util import parseNodeAddress
class ConfigurationManager(object): class ConfigurationManager(object):
""" """
......
...@@ -19,18 +19,15 @@ from functools import wraps ...@@ -19,18 +19,15 @@ from functools import wraps
from time import time from time import time
import neo.lib import neo.lib
from neo.lib.locking import RLock from . import attributeTracker
from .connector import ConnectorException, ConnectorTryAgainException, \
from neo.lib.protocol import PacketMalformedError, Packets, ParserState
from neo.lib.connector import ConnectorException, ConnectorTryAgainException, \
ConnectorInProgressException, ConnectorConnectionRefusedException, \ ConnectorInProgressException, ConnectorConnectionRefusedException, \
ConnectorConnectionClosedException ConnectorConnectionClosedException
from neo.lib.util import dump from .locking import RLock
from neo.lib.logger import PACKET_LOGGER from .logger import PACKET_LOGGER
from .profiling import profiler_decorator
from neo.lib import attributeTracker from .protocol import PacketMalformedError, Packets, ParserState
from neo.lib.util import ReadBuffer from .util import dump, ReadBuffer
from neo.lib.profiling import profiler_decorator
CRITICAL_TIMEOUT = 30 CRITICAL_TIMEOUT = 30
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from functools import wraps from functools import wraps
from neo.lib.locking import Lock, Empty from .locking import Lock, Empty
from neo.lib.profiling import profiler_decorator from .profiling import profiler_decorator
EMPTY = {} EMPTY = {}
NOBODY = [] NOBODY = []
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
from time import time from time import time
import neo.lib import neo.lib
from neo.lib.epoll import Epoll from .epoll import Epoll
from neo.lib.profiling import profiler_decorator from .profiling import profiler_decorator
class EpollEventManager(object): class EpollEventManager(object):
"""This class manages connections and events based on epoll(5).""" """This class manages connections and events based on epoll(5)."""
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import neo.lib import neo.lib
from neo.lib.protocol import NodeStates, ErrorCodes, Packets, Errors from .protocol import (
from neo.lib.protocol import PacketMalformedError, UnexpectedPacketError, \ NodeStates, Packets, ErrorCodes, Errors, BrokenNodeDisallowedError,
BrokenNodeDisallowedError, NotReadyError, ProtocolError NotReadyError, PacketMalformedError, ProtocolError, UnexpectedPacketError)
class EventHandler(object): class EventHandler(object):
......
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
from base64 import b64encode from base64 import b64encode
import neo import neo
from neo.lib.protocol import PacketMalformedError from .protocol import PacketMalformedError
from neo.lib.util import dump from .util import dump
from neo.lib.handler import EventHandler from .handler import EventHandler
from neo.lib.profiling import profiler_decorator from .profiling import profiler_decorator
LOGGER_ENABLED = False LOGGER_ENABLED = False
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
from time import time from time import time
import neo.lib import neo.lib
from neo.lib.util import dump from .util import dump
from neo.lib.protocol import NodeTypes, NodeStates from .protocol import NodeTypes, NodeStates
from neo.lib import attributeTracker from . import attributeTracker
class Node(object): class Node(object):
"""This class represents a node.""" """This class represents a node."""
......
...@@ -22,7 +22,7 @@ from socket import inet_ntoa, inet_aton ...@@ -22,7 +22,7 @@ from socket import inet_ntoa, inet_aton
from cStringIO import StringIO from cStringIO import StringIO
from struct import Struct from struct import Struct
from neo.lib.util import Enum, getAddressType from .util import Enum, getAddressType
# The protocol version (major, minor). # The protocol version (major, minor).
PROTOCOL_VERSION = (4, 1) PROTOCOL_VERSION = (4, 1)
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
from functools import wraps from functools import wraps
import neo import neo
from neo.lib import protocol from . import protocol
from neo.lib.protocol import CellStates from .protocol import CellStates
from neo.lib.util import dump, u64 from .util import dump, u64
from neo.lib.locking import RLock from .locking import RLock
class PartitionTableException(Exception): class PartitionTableException(Exception):
""" """
......
...@@ -20,23 +20,22 @@ import os, sys ...@@ -20,23 +20,22 @@ import os, sys
from time import time from time import time
from neo.lib import protocol from neo.lib import protocol
from neo.lib.connector import getConnectorHandler
from neo.lib.debug import register as registerLiveDebugger
from neo.lib.protocol import UUID_NAMESPACES, ZERO_TID from neo.lib.protocol import UUID_NAMESPACES, ZERO_TID
from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, Packets from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, Packets
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from neo.lib.event import EventManager from neo.lib.event import EventManager
from neo.lib.connection import ListeningConnection, ClientConnection from neo.lib.connection import ListeningConnection, ClientConnection
from neo.lib.exception import ElectionFailure, PrimaryFailure, OperationFailure from neo.lib.exception import ElectionFailure, PrimaryFailure, OperationFailure
from neo.master.handlers import election, identification, secondary
from neo.master.handlers import storage, client, shutdown
from neo.master.handlers import administration
from neo.master.pt import PartitionTable
from neo.master.transactions import TransactionManager
from neo.master.verification import VerificationManager
from neo.master.recovery import RecoveryManager
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.connector import getConnectorHandler from .handlers import election, identification, secondary
from .handlers import administration, client, storage, shutdown
from .pt import PartitionTable
from .recovery import RecoveryManager
from .transactions import TransactionManager
from .verification import VerificationManager
from neo.lib.debug import register as registerLiveDebugger
class Application(object): class Application(object):
"""The master node application.""" """The master node application."""
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import neo import neo
from neo.master.handlers import MasterHandler from . import MasterHandler
from neo.lib.protocol import ClusterStates, NodeStates, Packets, ProtocolError from neo.lib.protocol import ClusterStates, NodeStates, Packets, ProtocolError
from neo.lib.protocol import Errors from neo.lib.protocol import Errors
from neo.lib.util import dump from neo.lib.util import dump
......
...@@ -16,11 +16,10 @@ ...@@ -16,11 +16,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import neo.lib import neo.lib
from neo.lib.protocol import NodeStates, Packets, ProtocolError from neo.lib.protocol import NodeStates, Packets, ProtocolError
from neo.master.handlers import MasterHandler
from neo.lib.util import dump from neo.lib.util import dump
from neo.master.transactions import DelayedError from . import MasterHandler
from ..transactions import DelayedError
class ClientServiceHandler(MasterHandler): class ClientServiceHandler(MasterHandler):
""" Handler dedicated to client during service state """ """ Handler dedicated to client during service state """
......
...@@ -21,9 +21,9 @@ from neo.lib.protocol import NodeTypes, NodeStates, Packets ...@@ -21,9 +21,9 @@ from neo.lib.protocol import NodeTypes, NodeStates, Packets
from neo.lib.protocol import NotReadyError, ProtocolError, \ from neo.lib.protocol import NotReadyError, ProtocolError, \
UnexpectedPacketError UnexpectedPacketError
from neo.lib.protocol import BrokenNodeDisallowedError from neo.lib.protocol import BrokenNodeDisallowedError
from neo.master.handlers import MasterHandler
from neo.lib.exception import ElectionFailure from neo.lib.exception import ElectionFailure
from neo.lib.util import dump from neo.lib.util import dump
from . import MasterHandler
class ClientElectionHandler(MasterHandler): class ClientElectionHandler(MasterHandler):
......
...@@ -19,7 +19,7 @@ import neo ...@@ -19,7 +19,7 @@ import neo
from neo.lib.protocol import NodeTypes, Packets from neo.lib.protocol import NodeTypes, Packets
from neo.lib.protocol import BrokenNodeDisallowedError, ProtocolError from neo.lib.protocol import BrokenNodeDisallowedError, ProtocolError
from neo.master.handlers import MasterHandler from . import MasterHandler
class IdentificationHandler(MasterHandler): class IdentificationHandler(MasterHandler):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from neo.master.handlers import MasterHandler from . import MasterHandler
from neo.lib.exception import ElectionFailure, PrimaryFailure from neo.lib.exception import ElectionFailure, PrimaryFailure
from neo.lib.protocol import NodeTypes, Packets from neo.lib.protocol import NodeTypes, Packets
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import neo.lib import neo.lib
from neo.lib import protocol from neo.lib import protocol
from neo.master.handlers import BaseServiceHandler from . import BaseServiceHandler
class ShutdownHandler(BaseServiceHandler): class ShutdownHandler(BaseServiceHandler):
"""This class deals with events for a shutting down phase.""" """This class deals with events for a shutting down phase."""
......
...@@ -16,14 +16,12 @@ ...@@ -16,14 +16,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import neo.lib import neo.lib
from neo.lib.protocol import Packets, ProtocolError
from neo.lib.protocol import ProtocolError
from neo.lib.protocol import Packets
from neo.master.handlers import BaseServiceHandler
from neo.lib.exception import OperationFailure from neo.lib.exception import OperationFailure
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.connector import ConnectorConnectionClosedException from neo.lib.connector import ConnectorConnectionClosedException
from neo.lib.pt import PartitionTableException from neo.lib.pt import PartitionTableException
from . import BaseServiceHandler
class StorageServiceHandler(BaseServiceHandler): class StorageServiceHandler(BaseServiceHandler):
......
...@@ -21,7 +21,7 @@ import neo ...@@ -21,7 +21,7 @@ import neo
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.protocol import Packets, ProtocolError, ClusterStates, NodeStates from neo.lib.protocol import Packets, ProtocolError, ClusterStates, NodeStates
from neo.lib.protocol import NotReadyError, ZERO_OID, ZERO_TID from neo.lib.protocol import NotReadyError, ZERO_OID, ZERO_TID
from neo.master.handlers import MasterHandler from .handlers import MasterHandler
class RecoveryManager(MasterHandler): class RecoveryManager(MasterHandler):
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import neo import neo
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.protocol import ClusterStates, Packets, NodeStates from neo.lib.protocol import ClusterStates, Packets, NodeStates
from neo.master.handlers import BaseServiceHandler from .handlers import BaseServiceHandler
class VerificationFailure(Exception): class VerificationFailure(Exception):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from neo.neoctl.neoctl import NeoCTL, NotReadyException from .neoctl import NeoCTL, NotReadyException
from neo.lib.util import bin, dump from neo.lib.util import bin, dump
from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
from neo.lib.connector import getConnectorHandler from neo.lib.connector import getConnectorHandler
from neo.lib.connection import ClientConnection from neo.lib.connection import ClientConnection
from neo.lib.event import EventManager from neo.lib.event import EventManager
from neo.neoctl.handler import CommandEventHandler
from neo.lib.protocol import ClusterStates, NodeStates, ErrorCodes, Packets from neo.lib.protocol import ClusterStates, NodeStates, ErrorCodes, Packets
from neo.lib.util import getConnectorFromAddress from neo.lib.util import getConnectorFromAddress
from .handler import CommandEventHandler
class NotReadyException(Exception): class NotReadyException(Exception):
pass pass
......
...@@ -24,16 +24,16 @@ from neo.lib.node import NodeManager ...@@ -24,16 +24,16 @@ from neo.lib.node import NodeManager
from neo.lib.event import EventManager from neo.lib.event import EventManager
from neo.lib.connection import ListeningConnection from neo.lib.connection import ListeningConnection
from neo.lib.exception import OperationFailure, PrimaryFailure from neo.lib.exception import OperationFailure, PrimaryFailure
from neo.storage.handlers import identification, verification, initialization
from neo.storage.handlers import master, hidden
from neo.storage.replicator import Replicator
from neo.storage.database import buildDatabaseManager
from neo.storage.transactions import TransactionManager
from neo.storage.exception import AlreadyPendingError
from neo.lib.connector import getConnectorHandler from neo.lib.connector import getConnectorHandler
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.bootstrap import BootstrapManager from neo.lib.bootstrap import BootstrapManager
from .database import buildDatabaseManager
from .exception import AlreadyPendingError
from .handlers import identification, verification, initialization
from .handlers import master, hidden
from .replicator import Replicator
from .transactions import TransactionManager
from neo.lib.debug import register as registerLiveDebugger from neo.lib.debug import register as registerLiveDebugger
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.storage.database.manager import DatabaseManager from .manager import DatabaseManager
DATABASE_MANAGER_DICT = {} DATABASE_MANAGER_DICT = {}
try: try:
from neo.storage.database.mysqldb import MySQLDatabaseManager from .mysqldb import MySQLDatabaseManager
except ImportError: except ImportError:
pass pass
else: else:
DATABASE_MANAGER_DICT['MySQL'] = MySQLDatabaseManager DATABASE_MANAGER_DICT['MySQL'] = MySQLDatabaseManager
try: try:
from neo.storage.database.btree import BTreeDatabaseManager from .btree import BTreeDatabaseManager
except ImportError: except ImportError:
pass pass
else: else:
......
...@@ -24,8 +24,8 @@ from BTrees.OOBTree import OOBTree as _OOBTree ...@@ -24,8 +24,8 @@ from BTrees.OOBTree import OOBTree as _OOBTree
import neo.lib import neo.lib
from hashlib import sha1 from hashlib import sha1
from neo.storage.database import DatabaseManager from . import DatabaseManager
from neo.storage.database.manager import CreationUndone from .manager import CreationUndone
from neo.lib.protocol import CellStates, ZERO_HASH, ZERO_OID, ZERO_TID from neo.lib.protocol import CellStates, ZERO_HASH, ZERO_OID, ZERO_TID
from neo.lib import util from neo.lib import util
......
...@@ -26,8 +26,8 @@ from hashlib import sha1 ...@@ -26,8 +26,8 @@ from hashlib import sha1
import re import re
import string import string
from neo.storage.database import DatabaseManager from . import DatabaseManager
from neo.storage.database.manager import CreationUndone from .manager import CreationUndone
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.lib.protocol import CellStates, ZERO_OID, ZERO_TID, ZERO_HASH from neo.lib.protocol import CellStates, ZERO_OID, ZERO_TID, ZERO_HASH
from neo.lib import util from neo.lib import util
......
...@@ -19,9 +19,9 @@ import neo.lib ...@@ -19,9 +19,9 @@ import neo.lib
from neo.lib import protocol from neo.lib import protocol
from neo.lib.util import dump, makeChecksum from neo.lib.util import dump, makeChecksum
from neo.lib.protocol import Packets, LockState, Errors, ZERO_HASH from neo.lib.protocol import Packets, LockState, Errors, ZERO_HASH
from neo.storage.handlers import BaseClientAndStorageOperationHandler from . import BaseClientAndStorageOperationHandler
from neo.storage.transactions import ConflictError, DelayedError from ..transactions import ConflictError, DelayedError
from neo.storage.exception import AlreadyPendingError from ..exception import AlreadyPendingError
import time import time
# Log stores taking (incl. lock delays) more than this many seconds. # Log stores taking (incl. lock delays) more than this many seconds.
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import neo.lib import neo.lib
from neo.storage.handlers import BaseMasterHandler from . import BaseMasterHandler
from neo.lib.protocol import CellStates from neo.lib.protocol import CellStates
class HiddenHandler(BaseMasterHandler): class HiddenHandler(BaseMasterHandler):
......
...@@ -41,7 +41,7 @@ class IdentificationHandler(EventHandler): ...@@ -41,7 +41,7 @@ class IdentificationHandler(EventHandler):
raise BrokenNodeDisallowedError raise BrokenNodeDisallowedError
# choose the handler according to the node type # choose the handler according to the node type
if node_type == NodeTypes.CLIENT: if node_type == NodeTypes.CLIENT:
from neo.storage.handlers.client import ClientOperationHandler from .client import ClientOperationHandler
handler = ClientOperationHandler handler = ClientOperationHandler
if node is None: if node is None:
node = app.nm.createClient() node = app.nm.createClient()
...@@ -51,7 +51,7 @@ class IdentificationHandler(EventHandler): ...@@ -51,7 +51,7 @@ class IdentificationHandler(EventHandler):
assert not node.isConnected() assert not node.isConnected()
node.setRunning() node.setRunning()
elif node_type == NodeTypes.STORAGE: elif node_type == NodeTypes.STORAGE:
from neo.storage.handlers.storage import StorageOperationHandler from .storage import StorageOperationHandler
handler = StorageOperationHandler handler = StorageOperationHandler
if node is None: if node is None:
neo.lib.logging.error('reject an unknown storage node %s', neo.lib.logging.error('reject an unknown storage node %s',
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import neo.lib import neo.lib
from neo.storage.handlers import BaseMasterHandler from . import BaseMasterHandler
from neo.lib import protocol from neo.lib import protocol
class InitializationHandler(BaseMasterHandler): class InitializationHandler(BaseMasterHandler):
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import neo.lib import neo.lib
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.protocol import CellStates, Packets, ProtocolError from neo.lib.protocol import CellStates, Packets, ProtocolError
from neo.storage.handlers import BaseMasterHandler from . import BaseMasterHandler
class MasterOperationHandler(BaseMasterHandler): class MasterOperationHandler(BaseMasterHandler):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from neo.storage.handlers import BaseClientAndStorageOperationHandler from . import BaseClientAndStorageOperationHandler
from neo.lib.protocol import Packets from neo.lib.protocol import Packets
class StorageOperationHandler(BaseClientAndStorageOperationHandler): class StorageOperationHandler(BaseClientAndStorageOperationHandler):
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import neo import neo
from neo.storage.handlers import BaseMasterHandler from . import BaseMasterHandler
from neo.lib.protocol import Packets, Errors, ProtocolError, INVALID_TID from neo.lib.protocol import Packets, Errors, ProtocolError, INVALID_TID
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.exception import OperationFailure from neo.lib.exception import OperationFailure
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import neo.lib import neo.lib
from random import choice from random import choice
from neo.storage.handlers import replication from .handlers import replication
from neo.lib.protocol import NodeTypes, NodeStates, Packets from neo.lib.protocol import NodeTypes, NodeStates, Packets
from neo.lib.connection import ClientConnection from neo.lib.connection import ClientConnection
from neo.lib.util import dump from neo.lib.util import dump
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from cPickle import dumps from cPickle import dumps
from mock import Mock, ReturnValues from mock import Mock, ReturnValues
from ZODB.POSException import StorageTransactionError, UndoError, ConflictError from ZODB.POSException import StorageTransactionError, UndoError, ConflictError
from neo.tests import NeoUnitTestBase, buildUrlFromString, ADDRESS_TYPE from .. import NeoUnitTestBase, buildUrlFromString, ADDRESS_TYPE
from neo.client.app import Application from neo.client.app import Application
from neo.client.exception import NEOStorageError, NEOStorageNotFoundError from neo.client.exception import NEOStorageError, NEOStorageNotFoundError
from neo.client.exception import NEOStorageDoesNotExistError from neo.client.exception import NEOStorageDoesNotExistError
...@@ -784,7 +784,7 @@ class ClientApplicationTests(NeoUnitTestBase): ...@@ -784,7 +784,7 @@ class ClientApplicationTests(NeoUnitTestBase):
# the third will not be ready # the third will not be ready
# after the third, the partition table will be operational # after the third, the partition table will be operational
# (as if it was connected to the primary master node) # (as if it was connected to the primary master node)
from neo.tests import DoNothingConnector from .. import DoNothingConnector
# will raise IndexError at the third iteration # will raise IndexError at the third iteration
app = self.getApp('127.0.0.1:10010 127.0.0.1:10011') app = self.getApp('127.0.0.1:10010 127.0.0.1:10011')
# TODO: test more connection failure cases # TODO: test more connection failure cases
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock, ReturnValues from mock import Mock, ReturnValues
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.client.app import ConnectionPool from neo.client.app import ConnectionPool
from neo.client.exception import NEOStorageError from neo.client.exception import NEOStorageError
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.lib.protocol import NodeTypes, NodeStates from neo.lib.protocol import NodeTypes, NodeStates
from neo.client.handlers.master import PrimaryBootstrapHandler from neo.client.handlers.master import PrimaryBootstrapHandler
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, LockState from neo.lib.protocol import NodeTypes, LockState
from neo.client.handlers.storage import StorageBootstrapHandler, \ from neo.client.handlers.storage import StorageBootstrapHandler, \
StorageAnswersHandler StorageAnswersHandler
......
...@@ -36,9 +36,9 @@ from neo.neoctl.neoctl import NeoCTL, NotReadyException ...@@ -36,9 +36,9 @@ from neo.neoctl.neoctl import NeoCTL, NotReadyException
from neo.lib import setupLog from neo.lib import setupLog
from neo.lib.protocol import ClusterStates, NodeTypes, CellStates, NodeStates from neo.lib.protocol import ClusterStates, NodeTypes, CellStates, NodeStates
from neo.lib.util import dump from neo.lib.util import dump
from neo.tests import DB_USER, setupMySQLdb, NeoTestBase, buildUrlFromString, \ from .. import DB_USER, setupMySQLdb, NeoTestBase, buildUrlFromString, \
ADDRESS_TYPE, IP_VERSION_FORMAT_DICT, getTempDirectory ADDRESS_TYPE, IP_VERSION_FORMAT_DICT, getTempDirectory
from neo.tests.cluster import SocketLock from ..cluster import SocketLock
from neo.client.Storage import Storage from neo.client.Storage import Storage
NEO_MASTER = 'neomaster' NEO_MASTER = 'neomaster'
......
...@@ -28,8 +28,8 @@ from ZODB.POSException import ConflictError ...@@ -28,8 +28,8 @@ from ZODB.POSException import ConflictError
from ZODB.tests.StorageTestBase import zodb_pickle from ZODB.tests.StorageTestBase import zodb_pickle
from persistent import Persistent from persistent import Persistent
from neo.lib.util import SOCKET_CONNECTORS_DICT from neo.lib.util import SOCKET_CONNECTORS_DICT
from neo.tests.functional import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
from neo.tests import IP_VERSION_FORMAT_DICT from .. import IP_VERSION_FORMAT_DICT
TREE_SIZE = 6 TREE_SIZE = 6
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
import transaction import transaction
from persistent import Persistent from persistent import Persistent
from neo.tests.functional import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
class ClusterTests(NEOFunctionalTest): class ClusterTests(NEOFunctionalTest):
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import unittest import unittest
from neo.tests.functional import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
from neo.lib.protocol import NodeStates from neo.lib.protocol import NodeStates
MASTER_NODE_COUNT = 3 MASTER_NODE_COUNT = 3
......
...@@ -20,7 +20,7 @@ import unittest ...@@ -20,7 +20,7 @@ import unittest
import transaction import transaction
from persistent import Persistent from persistent import Persistent
from neo.tests.functional import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
from neo.lib.protocol import ClusterStates, NodeStates from neo.lib.protocol import ClusterStates, NodeStates
from ZODB.tests.StorageTestBase import zodb_pickle from ZODB.tests.StorageTestBase import zodb_pickle
from MySQLdb import ProgrammingError from MySQLdb import ProgrammingError
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from struct import pack, unpack from struct import pack, unpack
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates, Packets from neo.lib.protocol import NodeTypes, NodeStates, Packets
from neo.master.handlers.client import ClientServiceHandler from neo.master.handlers.client import ClientServiceHandler
from neo.master.app import Application from neo.master.app import Application
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.lib import protocol from neo.lib import protocol
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import Packet, NodeTypes, NodeStates from neo.lib.protocol import Packet, NodeTypes, NodeStates
from neo.master.handlers.election import ClientElectionHandler, \ from neo.master.handlers.election import ClientElectionHandler, \
ServerElectionHandler ServerElectionHandler
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.master.app import Application from neo.master.app import Application
from neo.lib.util import p64, u64 from neo.lib.util import p64, u64
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeStates, CellStates from neo.lib.protocol import NodeStates, CellStates
from neo.master.pt import PartitionTable from neo.master.pt import PartitionTable
from neo.lib.node import StorageNode from neo.lib.node import StorageNode
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from struct import pack, unpack from struct import pack, unpack
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates, CellStates from neo.lib.protocol import NodeTypes, NodeStates, CellStates
from neo.master.recovery import RecoveryManager from neo.master.recovery import RecoveryManager
from neo.master.app import Application from neo.master.app import Application
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from struct import pack from struct import pack
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates, Packets from neo.lib.protocol import NodeTypes, NodeStates, Packets
from neo.master.handlers.storage import StorageServiceHandler from neo.master.handlers.storage import StorageServiceHandler
from neo.master.handlers.client import ClientServiceHandler from neo.master.handlers.client import ClientServiceHandler
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from struct import pack, unpack from struct import pack, unpack
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import ZERO_TID from neo.lib.protocol import ZERO_TID
from neo.master.transactions import Transaction, TransactionManager from neo.master.transactions import Transaction, TransactionManager
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from struct import pack, unpack from struct import pack, unpack
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NodeStates from neo.lib.protocol import NodeTypes, NodeStates
from neo.master.verification import VerificationManager, VerificationFailure from neo.master.verification import VerificationManager, VerificationFailure
from neo.master.app import Application from neo.master.app import Application
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from mock import Mock, ReturnValues from mock import Mock, ReturnValues
from collections import deque from collections import deque
from neo.lib.util import makeChecksum from neo.lib.util import makeChecksum
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.storage.transactions import ConflictError, DelayedError from neo.storage.transactions import ConflictError, DelayedError
from neo.storage.handlers.client import ClientOperationHandler from neo.storage.handlers.client import ClientOperationHandler
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeTypes, NotReadyError, \ from neo.lib.protocol import NodeTypes, NotReadyError, \
BrokenNodeDisallowedError BrokenNodeDisallowedError
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.storage.app import Application from neo.storage.app import Application
from neo.storage.handlers.initialization import InitializationHandler from neo.storage.handlers.initialization import InitializationHandler
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from collections import deque from collections import deque
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.storage.handlers.master import MasterOperationHandler from neo.storage.handlers.master import MasterOperationHandler
from neo.lib.exception import PrimaryFailure, OperationFailure from neo.lib.exception import PrimaryFailure, OperationFailure
......
...@@ -20,7 +20,7 @@ from mock import Mock ...@@ -20,7 +20,7 @@ from mock import Mock
from struct import pack from struct import pack
from collections import deque from collections import deque
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.database import buildDatabaseManager from neo.storage.database import buildDatabaseManager
from neo.storage.handlers.replication import ReplicationHandler from neo.storage.handlers.replication import ReplicationHandler
from neo.storage.handlers.replication import RANGE_LENGTH from neo.storage.handlers.replication import RANGE_LENGTH
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.lib.util import add64 from neo.lib.util import add64
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import Packets, ZERO_OID, ZERO_TID from neo.lib.protocol import Packets, ZERO_OID, ZERO_TID
from neo.storage.handlers.replication import ReplicationHandler from neo.storage.handlers.replication import ReplicationHandler
from neo.storage.handlers.replication import RANGE_LENGTH, MIN_RANGE_LENGTH from neo.storage.handlers.replication import RANGE_LENGTH, MIN_RANGE_LENGTH
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock, ReturnValues from mock import Mock, ReturnValues
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.replicator import Replicator, Partition, Task from neo.storage.replicator import Replicator, Partition, Task
from neo.lib.protocol import CellStates, NodeStates, Packets from neo.lib.protocol import CellStates, NodeStates, Packets
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock, ReturnValues from mock import Mock, ReturnValues
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.lib.protocol import CellStates from neo.lib.protocol import CellStates
from collections import deque from collections import deque
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests.storage.testStorageDBTests import StorageDBTests from .testStorageDBTests import StorageDBTests
from neo.storage.database.btree import BTreeDatabaseManager from neo.storage.database.btree import BTreeDatabaseManager
class StorageBTreeTests(StorageDBTests): class StorageBTreeTests(StorageDBTests):
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from mock import Mock from mock import Mock
from neo.lib.util import dump, p64, u64 from neo.lib.util import dump, p64, u64
from neo.lib.protocol import CellStates, ZERO_OID, ZERO_TID from neo.lib.protocol import CellStates, ZERO_OID, ZERO_TID
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.storage.database.mysqldb import MySQLDatabaseManager from neo.storage.database.mysqldb import MySQLDatabaseManager
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from collections import deque from collections import deque
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.storage.handlers.storage import StorageOperationHandler from neo.storage.handlers.storage import StorageOperationHandler
from neo.lib.protocol import INVALID_PARTITION, Packets from neo.lib.protocol import INVALID_PARTITION, Packets
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
import MySQLdb import MySQLdb
from mock import Mock from mock import Mock
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.tests.storage.testStorageDBTests import StorageDBTests from .testStorageDBTests import StorageDBTests
from neo.storage.database.mysqldb import MySQLDatabaseManager from neo.storage.database.mysqldb import MySQLDatabaseManager
NEO_SQL_DATABASE = 'test_mysqldb0' NEO_SQL_DATABASE = 'test_mysqldb0'
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.storage.transactions import Transaction, TransactionManager from neo.storage.transactions import Transaction, TransactionManager
from neo.storage.transactions import ConflictError, DelayedError from neo.storage.transactions import ConflictError, DelayedError
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.storage.app import Application from neo.storage.app import Application
from neo.storage.handlers.verification import VerificationHandler from neo.storage.handlers.verification import VerificationHandler
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from . import NeoUnitTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.lib.bootstrap import BootstrapManager from neo.lib.bootstrap import BootstrapManager
from neo.lib.protocol import NodeTypes from neo.lib.protocol import NodeTypes
......
...@@ -22,12 +22,12 @@ from neo.lib.connection import ListeningConnection, Connection, \ ...@@ -22,12 +22,12 @@ from neo.lib.connection import ListeningConnection, Connection, \
ClientConnection, ServerConnection, MTClientConnection, \ ClientConnection, ServerConnection, MTClientConnection, \
HandlerSwitcher, CRITICAL_TIMEOUT HandlerSwitcher, CRITICAL_TIMEOUT
from neo.lib.connector import getConnectorHandler, registerConnectorHandler from neo.lib.connector import getConnectorHandler, registerConnectorHandler
from neo.tests import DoNothingConnector from . import DoNothingConnector
from neo.lib.connector import ConnectorException, ConnectorTryAgainException, \ from neo.lib.connector import ConnectorException, ConnectorTryAgainException, \
ConnectorInProgressException, ConnectorConnectionRefusedException ConnectorInProgressException, ConnectorConnectionRefusedException
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.protocol import Packets, ParserState from neo.lib.protocol import Packets, ParserState
from neo.tests import NeoUnitTestBase from . import NeoUnitTestBase
from neo.lib.util import ReadBuffer from neo.lib.util import ReadBuffer
from neo.lib.locking import Queue from neo.lib.locking import Queue
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from mock import Mock from mock import Mock
from neo.tests import NeoTestBase from . import NeoTestBase
from neo.lib.dispatcher import Dispatcher, ForgottenPacket from neo.lib.dispatcher import Dispatcher, ForgottenPacket
from Queue import Queue from Queue import Queue
import unittest import unittest
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from . import NeoUnitTestBase
from neo.lib.epoll import Epoll from neo.lib.epoll import Epoll
from neo.lib.event import EpollEventManager from neo.lib.event import EpollEventManager
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoUnitTestBase from . import NeoUnitTestBase
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.protocol import PacketMalformedError, UnexpectedPacketError, \ from neo.lib.protocol import PacketMalformedError, UnexpectedPacketError, \
BrokenNodeDisallowedError, NotReadyError, ProtocolError BrokenNodeDisallowedError, NotReadyError, ProtocolError
......
...@@ -21,7 +21,7 @@ from neo.lib import protocol ...@@ -21,7 +21,7 @@ from neo.lib import protocol
from neo.lib.protocol import NodeTypes, NodeStates from neo.lib.protocol import NodeTypes, NodeStates
from neo.lib.node import Node, MasterNode, StorageNode, \ from neo.lib.node import Node, MasterNode, StorageNode, \
ClientNode, AdminNode, NodeManager ClientNode, AdminNode, NodeManager
from neo.tests import NeoUnitTestBase from . import NeoUnitTestBase
from time import time from time import time
class NodesTests(NeoUnitTestBase): class NodesTests(NeoUnitTestBase):
......
...@@ -20,7 +20,7 @@ from mock import Mock ...@@ -20,7 +20,7 @@ from mock import Mock
from neo.lib.protocol import NodeStates, CellStates from neo.lib.protocol import NodeStates, CellStates
from neo.lib.pt import Cell, PartitionTable, PartitionTableException from neo.lib.pt import Cell, PartitionTable, PartitionTableException
from neo.lib.node import StorageNode from neo.lib.node import StorageNode
from neo.tests import NeoUnitTestBase from . import NeoUnitTestBase
class PartitionTableTests(NeoUnitTestBase): class PartitionTableTests(NeoUnitTestBase):
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
import socket import socket
from neo.lib.protocol import NodeTypes, NodeStates, CellStates, ClusterStates from neo.lib.protocol import NodeTypes, NodeStates, CellStates, ClusterStates
from neo.lib.protocol import ErrorCodes, Packets, Errors, LockState from neo.lib.protocol import ErrorCodes, Packets, Errors, LockState
from neo.tests import NeoUnitTestBase, IP_VERSION_FORMAT_DICT from . import NeoUnitTestBase, IP_VERSION_FORMAT_DICT
class ProtocolTests(NeoUnitTestBase): class ProtocolTests(NeoUnitTestBase):
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import unittest import unittest
import socket import socket
from neo.tests import NeoUnitTestBase, IP_VERSION_FORMAT_DICT from . import NeoUnitTestBase, IP_VERSION_FORMAT_DICT
from neo.lib.util import ReadBuffer, getAddressType, parseNodeAddress, \ from neo.lib.util import ReadBuffer, getAddressType, parseNodeAddress, \
getConnectorFromAddress, SOCKET_CONNECTORS_DICT getConnectorFromAddress, SOCKET_CONNECTORS_DICT
......
...@@ -32,7 +32,7 @@ from neo.lib.connector import SocketConnector, \ ...@@ -32,7 +32,7 @@ from neo.lib.connector import SocketConnector, \
from neo.lib.event import EventManager from neo.lib.event import EventManager
from neo.lib.protocol import CellStates, ClusterStates, NodeStates, NodeTypes from neo.lib.protocol import CellStates, ClusterStates, NodeStates, NodeTypes
from neo.lib.util import SOCKET_CONNECTORS_DICT, parseMasterList from neo.lib.util import SOCKET_CONNECTORS_DICT, parseMasterList
from neo.tests import NeoTestBase, getTempDirectory, setupMySQLdb, \ from .. import NeoTestBase, getTempDirectory, setupMySQLdb, \
ADDRESS_TYPE, IP_VERSION_FORMAT_DICT, DB_PREFIX, DB_USER ADDRESS_TYPE, IP_VERSION_FORMAT_DICT, DB_PREFIX, DB_USER
BIND = IP_VERSION_FORMAT_DICT[ADDRESS_TYPE], 0 BIND = IP_VERSION_FORMAT_DICT[ADDRESS_TYPE], 0
......
...@@ -24,7 +24,7 @@ from neo.storage.transactions import TransactionManager, \ ...@@ -24,7 +24,7 @@ from neo.storage.transactions import TransactionManager, \
DelayedError, ConflictError DelayedError, ConflictError
from neo.lib.connection import MTClientConnection from neo.lib.connection import MTClientConnection
from neo.lib.protocol import NodeStates, Packets, ZERO_TID from neo.lib.protocol import NodeStates, Packets, ZERO_TID
from neo.tests.threaded import NEOCluster, NEOThreadedTest, \ from . import NEOCluster, NEOThreadedTest, \
Patch, ConnectionFilter Patch, ConnectionFilter
from neo.lib.util import makeChecksum from neo.lib.util import makeChecksum
from neo.client.pool import CELL_CONNECTED, CELL_GOOD from neo.client.pool import CELL_CONNECTED, CELL_GOOD
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
import os import os
from neo.tests import DB_PREFIX from .. import DB_PREFIX
functional = int(os.getenv('NEO_TEST_ZODB_FUNCTIONAL', 0)) functional = int(os.getenv('NEO_TEST_ZODB_FUNCTIONAL', 0))
if functional: if functional:
from neo.tests.functional import NEOCluster, NEOFunctionalTest as TestCase from ..functional import NEOCluster, NEOFunctionalTest as TestCase
else: else:
from neo.tests.threaded import NEOCluster, NEOThreadedTest as TestCase from ..threaded import NEOCluster, NEOThreadedTest as TestCase
class ZODBTestCase(TestCase): class ZODBTestCase(TestCase):
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.BasicStorage import BasicStorage from ZODB.tests.BasicStorage import BasicStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class BasicTests(ZODBTestCase, StorageTestBase, BasicStorage): class BasicTests(ZODBTestCase, StorageTestBase, BasicStorage):
pass pass
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.ConflictResolution import ConflictResolvingStorage from ZODB.tests.ConflictResolution import ConflictResolvingStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class ConflictTests(ZODBTestCase, StorageTestBase, ConflictResolvingStorage): class ConflictTests(ZODBTestCase, StorageTestBase, ConflictResolvingStorage):
pass pass
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.HistoryStorage import HistoryStorage from ZODB.tests.HistoryStorage import HistoryStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class HistoryTests(ZODBTestCase, StorageTestBase, HistoryStorage): class HistoryTests(ZODBTestCase, StorageTestBase, HistoryStorage):
pass pass
......
...@@ -20,7 +20,7 @@ from ZODB.tests.IteratorStorage import IteratorStorage ...@@ -20,7 +20,7 @@ from ZODB.tests.IteratorStorage import IteratorStorage
from ZODB.tests.IteratorStorage import ExtendedIteratorStorage from ZODB.tests.IteratorStorage import ExtendedIteratorStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class IteratorTests(ZODBTestCase, StorageTestBase, IteratorStorage, class IteratorTests(ZODBTestCase, StorageTestBase, IteratorStorage,
ExtendedIteratorStorage): ExtendedIteratorStorage):
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.MTStorage import MTStorage from ZODB.tests.MTStorage import MTStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class MTTests(ZODBTestCase, StorageTestBase, MTStorage): class MTTests(ZODBTestCase, StorageTestBase, MTStorage):
pass pass
......
...@@ -25,7 +25,7 @@ except ImportError: ...@@ -25,7 +25,7 @@ except ImportError:
from ZODB.tests.PackableStorage import PackableUndoStorage from ZODB.tests.PackableStorage import PackableUndoStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class PackableTests(ZODBTestCase, StorageTestBase, class PackableTests(ZODBTestCase, StorageTestBase,
PackableStorageWithOptionalGC, PackableUndoStorage): PackableStorageWithOptionalGC, PackableUndoStorage):
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.PersistentStorage import PersistentStorage from ZODB.tests.PersistentStorage import PersistentStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class PersistentTests(ZODBTestCase, StorageTestBase, PersistentStorage): class PersistentTests(ZODBTestCase, StorageTestBase, PersistentStorage):
pass pass
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.ReadOnlyStorage import ReadOnlyStorage from ZODB.tests.ReadOnlyStorage import ReadOnlyStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class ReadOnlyTests(ZODBTestCase, StorageTestBase, ReadOnlyStorage): class ReadOnlyTests(ZODBTestCase, StorageTestBase, ReadOnlyStorage):
pass pass
......
...@@ -22,8 +22,8 @@ import ZODB ...@@ -22,8 +22,8 @@ import ZODB
from ZODB.tests.RecoveryStorage import RecoveryStorage from ZODB.tests.RecoveryStorage import RecoveryStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.functional import NEOCluster from ..functional import NEOCluster
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class RecoveryTests(ZODBTestCase, StorageTestBase, RecoveryStorage): class RecoveryTests(ZODBTestCase, StorageTestBase, RecoveryStorage):
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.RevisionStorage import RevisionStorage from ZODB.tests.RevisionStorage import RevisionStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class RevisionTests(ZODBTestCase, StorageTestBase, RevisionStorage): class RevisionTests(ZODBTestCase, StorageTestBase, RevisionStorage):
pass pass
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from ZODB.tests.Synchronization import SynchronizedStorage from ZODB.tests.Synchronization import SynchronizedStorage
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class SynchronizationTests(ZODBTestCase, StorageTestBase, SynchronizedStorage): class SynchronizationTests(ZODBTestCase, StorageTestBase, SynchronizedStorage):
pass pass
......
...@@ -20,7 +20,7 @@ from ZODB.tests.StorageTestBase import StorageTestBase ...@@ -20,7 +20,7 @@ from ZODB.tests.StorageTestBase import StorageTestBase
from ZODB.tests.TransactionalUndoStorage import TransactionalUndoStorage from ZODB.tests.TransactionalUndoStorage import TransactionalUndoStorage
from ZODB.tests.ConflictResolution import ConflictResolvingTransUndoStorage from ZODB.tests.ConflictResolution import ConflictResolvingTransUndoStorage
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class UndoTests(ZODBTestCase, StorageTestBase, TransactionalUndoStorage, class UndoTests(ZODBTestCase, StorageTestBase, TransactionalUndoStorage,
ConflictResolvingTransUndoStorage): ConflictResolvingTransUndoStorage):
......
...@@ -21,7 +21,7 @@ from ZODB.tests.TransactionalUndoVersionStorage import \ ...@@ -21,7 +21,7 @@ from ZODB.tests.TransactionalUndoVersionStorage import \
TransactionalUndoVersionStorage TransactionalUndoVersionStorage
from ZODB.tests.StorageTestBase import StorageTestBase from ZODB.tests.StorageTestBase import StorageTestBase
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class VersionTests(ZODBTestCase, StorageTestBase, VersionStorage, class VersionTests(ZODBTestCase, StorageTestBase, VersionStorage,
TransactionalUndoVersionStorage): TransactionalUndoVersionStorage):
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from ZODB.tests import testZODB from ZODB.tests import testZODB
import ZODB import ZODB
from neo.tests.zodb import ZODBTestCase from . import ZODBTestCase
class NEOZODBTests(ZODBTestCase, testZODB.ZODBTests): class NEOZODBTests(ZODBTestCase, testZODB.ZODBTests):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment