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