Commit e3926ad4 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Clean import of test module (thanks to pylint).


git-svn-id: https://svn.erp5.org/repos/neo/trunk@1344 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ef7eedd3
...@@ -23,7 +23,7 @@ from neo.client.app import Application ...@@ -23,7 +23,7 @@ from neo.client.app import Application
from neo.client.exception import NEOStorageError, NEOStorageNotFoundError, \ from neo.client.exception import NEOStorageError, NEOStorageNotFoundError, \
NEOStorageConflictError NEOStorageConflictError
from neo import protocol from neo import protocol
from neo.protocol import * from neo.protocol import INVALID_TID
from neo.util import makeChecksum from neo.util import makeChecksum
import neo.connection import neo.connection
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
# 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 import logging
import threading import threading
from mock import Mock, ReturnValues from mock import Mock, ReturnValues
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import unittest import unittest
from neo.tests.functional import NEOCluster, NEOFunctionalTest from neo.tests.functional import NEOCluster, NEOFunctionalTest
from neo import protocol
class ClusterTests(NEOFunctionalTest): class ClusterTests(NEOFunctionalTest):
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import os import os
import unittest import unittest
import tempfile
import transaction import transaction
import ZODB import ZODB
...@@ -25,7 +24,6 @@ from ZODB.FileStorage import FileStorage ...@@ -25,7 +24,6 @@ from ZODB.FileStorage import FileStorage
from Persistence import Persistent from Persistence import Persistent
from neo.tests.functional import NEOCluster, NEOFunctionalTest from neo.tests.functional import NEOCluster, NEOFunctionalTest
from neo.client.Storage import Storage as NEOStorage
TREE_SIZE = 6 TREE_SIZE = 6
......
...@@ -15,13 +15,9 @@ ...@@ -15,13 +15,9 @@
# 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 time import sleep, time
import unittest import unittest
from neo.tests.functional import NEOCluster, NEOFunctionalTest from neo.tests.functional import NEOCluster, NEOFunctionalTest
from neo.neoctl.neoctl import NotReadyException
from neo import protocol
from neo.protocol import NodeStates from neo.protocol import NodeStates
from neo.util import dump
MASTER_NODE_COUNT = 3 MASTER_NODE_COUNT = 3
......
...@@ -15,14 +15,11 @@ ...@@ -15,14 +15,11 @@
# 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.
import ZODB
import unittest import unittest
import transaction import transaction
from Persistence import Persistent from Persistence import Persistent
from neo.tests.functional import NEOCluster, NEOFunctionalTest from neo.tests.functional import NEOCluster, NEOFunctionalTest
from neo.client.Storage import Storage as NEOStorage
from neo import protocol
from neo.protocol import ClusterStates, NodeStates from neo.protocol import ClusterStates, NodeStates
class PObject(Persistent): class PObject(Persistent):
......
...@@ -15,7 +15,7 @@ import unittest ...@@ -15,7 +15,7 @@ import unittest
import ZODB import ZODB
import ZODB.FileStorage import ZODB.FileStorage
from ZODB.POSException import ReadConflictError, ConflictError from ZODB.POSException import ReadConflictError
from ZODB.POSException import TransactionFailedError from ZODB.POSException import TransactionFailedError
from ZODB.tests.warnhook import WarningsHook from ZODB.tests.warnhook import WarningsHook
......
...@@ -15,18 +15,15 @@ ...@@ -15,18 +15,15 @@
# 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.
import os
import unittest import unittest
from neo import logging
from mock import Mock from mock import Mock
from struct import pack, unpack from struct import pack, unpack
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
import neo.master
from neo import protocol from neo import protocol
from neo.protocol import Packet, PacketTypes, NodeTypes, NodeStates from neo.protocol import Packet, PacketTypes, NodeTypes, NodeStates
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
from neo.exception import OperationFailure, ElectionFailure from neo.exception import OperationFailure
class MasterClientHandlerTests(NeoTestBase): class MasterClientHandlerTests(NeoTestBase):
......
...@@ -15,17 +15,14 @@ ...@@ -15,17 +15,14 @@
# 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.
import os
import unittest import unittest
from neo import logging
from mock import Mock from mock import Mock
from struct import pack, unpack
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo import protocol from neo import protocol
from neo.protocol import Packet, PacketTypes, NodeTypes, NodeStates, INVALID_UUID from neo.protocol import Packet, PacketTypes, NodeTypes, NodeStates, INVALID_UUID
from neo.master.handlers.election import ClientElectionHandler, ServerElectionHandler from neo.master.handlers.election import ClientElectionHandler, ServerElectionHandler
from neo.master.app import Application from neo.master.app import Application
from neo.exception import OperationFailure, ElectionFailure from neo.exception import ElectionFailure
from neo.tests import DoNothingConnector from neo.tests import DoNothingConnector
from neo.connection import ClientConnection from neo.connection import ClientConnection
......
...@@ -15,12 +15,10 @@ ...@@ -15,12 +15,10 @@
# 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.
import unittest, logging, os import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.master.app import Application from neo.master.app import Application
from neo.protocol import INVALID_PTID, INVALID_OID, INVALID_TID, \
INVALID_UUID, Packet
from neo.storage.mysqldb import p64, u64 from neo.storage.mysqldb import p64, u64
class MasterAppTests(NeoTestBase): class MasterAppTests(NeoTestBase):
......
...@@ -15,11 +15,10 @@ ...@@ -15,11 +15,10 @@
# 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.
import unittest, os import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.protocol import NodeStates, CellStates from neo.protocol import NodeStates, CellStates
from neo.pt import Cell
from neo.master.pt import PartitionTable from neo.master.pt import PartitionTable
from neo.node import StorageNode from neo.node import StorageNode
......
...@@ -15,19 +15,13 @@ ...@@ -15,19 +15,13 @@
# 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.
import os
import unittest import unittest
from neo import logging
from mock import Mock
from struct import pack, unpack from struct import pack, unpack
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.protocol import Packet, PacketTypes from neo.protocol import Packet, PacketTypes
from neo.protocol import NodeTypes, NodeStates, CellStates from neo.protocol import NodeTypes, NodeStates, CellStates
from neo.master.handlers.recovery import RecoveryHandler from neo.master.handlers.recovery import RecoveryHandler
from neo.master.app import Application from neo.master.app import Application
from neo.exception import OperationFailure, ElectionFailure
from neo.tests import DoNothingConnector
from neo.connection import ClientConnection
class MasterRecoveryTests(NeoTestBase): class MasterRecoveryTests(NeoTestBase):
......
...@@ -15,19 +15,17 @@ ...@@ -15,19 +15,17 @@
# 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.
import os
import unittest import unittest
from neo import logging from neo import logging
from mock import Mock from mock import Mock
from struct import pack, unpack from struct import pack, unpack
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
import neo.master
from neo import protocol from neo import protocol
from neo.protocol import Packet, PacketTypes from neo.protocol import Packet, PacketTypes
from neo.protocol import NodeTypes, NodeStates, CellStates from neo.protocol import NodeTypes, NodeStates, CellStates
from neo.master.handlers.storage import StorageServiceHandler from neo.master.handlers.storage import StorageServiceHandler
from neo.master.app import Application from neo.master.app import Application
from neo.exception import OperationFailure, ElectionFailure from neo.exception import OperationFailure
class MasterStorageHandlerTests(NeoTestBase): class MasterStorageHandlerTests(NeoTestBase):
......
...@@ -15,20 +15,14 @@ ...@@ -15,20 +15,14 @@
# 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.
import os
import unittest import unittest
from neo import logging
from mock import Mock
from struct import pack, unpack from struct import pack, unpack
import neo
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.protocol import Packet, PacketTypes from neo.protocol import Packet, PacketTypes
from neo.protocol import NodeTypes, NodeStates, CellStates, ErrorCodes from neo.protocol import NodeTypes, NodeStates, ErrorCodes
from neo.master.handlers.verification import VerificationHandler from neo.master.handlers.verification import VerificationHandler
from neo.master.app import Application from neo.master.app import Application
from neo.exception import OperationFailure, ElectionFailure, VerificationFailure from neo.exception import VerificationFailure
from neo.tests import DoNothingConnector
from neo.connection import ClientConnection
class MasterVerificationTests(NeoTestBase): class MasterVerificationTests(NeoTestBase):
......
...@@ -27,8 +27,8 @@ from neo.storage.handlers.client import TransactionInformation ...@@ -27,8 +27,8 @@ from neo.storage.handlers.client import TransactionInformation
from neo.storage.handlers.client import ClientOperationHandler from neo.storage.handlers.client import ClientOperationHandler
from neo.exception import PrimaryFailure, OperationFailure from neo.exception import PrimaryFailure, OperationFailure
from neo.pt import PartitionTable from neo.pt import PartitionTable
from neo.protocol import * from neo.protocol import PacketTypes, Packet, INVALID_PARTITION
from neo.protocol import PacketTypes from neo.protocol import INVALID_TID, INVALID_OID, INVALID_SERIAL
class StorageClientHandlerTests(NeoTestBase): class StorageClientHandlerTests(NeoTestBase):
......
...@@ -15,18 +15,14 @@ ...@@ -15,18 +15,14 @@
# 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.
import os
import unittest import unittest
from neo import logging
from mock import Mock from mock import Mock
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo import protocol
from neo.pt import PartitionTable from neo.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
from neo.protocol import Packet, PacketTypes, CellStates from neo.protocol import Packet, PacketTypes, CellStates
from neo.exception import PrimaryFailure, OperationFailure from neo.exception import PrimaryFailure
from neo.storage.mysqldb import MySQLDatabaseManager, p64, u64
class StorageInitializationHandlerTests(NeoTestBase): class StorageInitializationHandlerTests(NeoTestBase):
......
...@@ -26,8 +26,8 @@ from neo.storage.app import Application ...@@ -26,8 +26,8 @@ from neo.storage.app import Application
from neo.storage.handlers.master import MasterOperationHandler from neo.storage.handlers.master import MasterOperationHandler
from neo.exception import PrimaryFailure, OperationFailure from neo.exception import PrimaryFailure, OperationFailure
from neo.pt import PartitionTable from neo.pt import PartitionTable
from neo.protocol import CellStates, PacketTypes from neo.protocol import CellStates, PacketTypes, Packet
from neo.protocol import * from neo.protocol import INVALID_TID, INVALID_OID
class StorageMasterHandlerTests(NeoTestBase): class StorageMasterHandlerTests(NeoTestBase):
......
...@@ -15,13 +15,11 @@ ...@@ -15,13 +15,11 @@
# 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.
import unittest, logging, os import unittest
from mock import Mock from mock import Mock
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.storage.app import Application from neo.storage.app import Application
from neo.protocol import Packet, CellStates, PacketTypes, \ from neo.protocol import CellStates
INVALID_PTID, INVALID_TID, INVALID_UUID
from neo.storage.mysqldb import p64, u64, MySQLDatabaseManager
from collections import deque from collections import deque
from neo.pt import PartitionTable from neo.pt import PartitionTable
from neo.util import dump from neo.util import dump
......
...@@ -24,8 +24,8 @@ from collections import deque ...@@ -24,8 +24,8 @@ from collections import deque
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
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.protocol import * from neo.protocol import PacketTypes, Packet, INVALID_PARTITION
from neo.protocol import PacketTypes from neo.protocol import INVALID_TID, INVALID_OID, INVALID_SERIAL
class StorageStorageHandlerTests(NeoTestBase): class StorageStorageHandlerTests(NeoTestBase):
......
...@@ -21,8 +21,7 @@ from neo import logging ...@@ -21,8 +21,7 @@ from neo import logging
import MySQLdb import MySQLdb
from mock import Mock from mock import Mock
from neo.util import dump from neo.util import dump
from neo.protocol import * from neo.protocol import CellStates, INVALID_PTID
from neo.protocol import CellStates
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.exception import DatabaseFailure from neo.exception import DatabaseFailure
from neo.storage.mysqldb import MySQLDatabaseManager, p64, u64 from neo.storage.mysqldb import MySQLDatabaseManager, p64, u64
......
...@@ -15,18 +15,16 @@ ...@@ -15,18 +15,16 @@
# 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.
import os
import unittest import unittest
from neo import logging
from mock import Mock from mock import Mock
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.pt import PartitionTable from neo.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
from neo.protocol import Packet, PacketTypes, CellStates, NodeTypes, ErrorCodes from neo.protocol import Packet, PacketTypes, CellStates, ErrorCodes
from neo.protocol import INVALID_OID, INVALID_TID from neo.protocol import INVALID_OID, INVALID_TID
from neo.exception import PrimaryFailure, OperationFailure from neo.exception import PrimaryFailure, OperationFailure
from neo.storage.mysqldb import MySQLDatabaseManager, p64, u64 from neo.storage.mysqldb import p64, u64
class StorageVerificationHandlerTests(NeoTestBase): class StorageVerificationHandlerTests(NeoTestBase):
......
...@@ -15,12 +15,9 @@ ...@@ -15,12 +15,9 @@
# 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.
import os
import unittest import unittest
from neo import logging
from mock import Mock from mock import Mock
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.pt import PartitionTable
from neo.storage.app import Application from neo.storage.app import Application
from neo.bootstrap import BootstrapManager from neo.bootstrap import BootstrapManager
from neo.protocol import NodeTypes from neo.protocol import NodeTypes
......
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# 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.
import unittest, os import unittest
from mock import Mock from mock import Mock
from neo import protocol
from time import time
from neo.connection import BaseConnection, ListeningConnection, Connection, \ from neo.connection import BaseConnection, ListeningConnection, Connection, \
ClientConnection, ServerConnection, MTClientConnection, MTServerConnection ClientConnection, ServerConnection, MTClientConnection, MTServerConnection
from neo.connector import getConnectorHandler, registerConnectorHandler from neo.connector import getConnectorHandler, registerConnectorHandler
...@@ -25,7 +23,7 @@ from neo.handler import EventHandler ...@@ -25,7 +23,7 @@ from neo.handler import EventHandler
from neo.tests import DoNothingConnector from neo.tests import DoNothingConnector
from neo.connector import ConnectorException, ConnectorTryAgainException, \ from neo.connector import ConnectorException, ConnectorTryAgainException, \
ConnectorInProgressException, ConnectorConnectionRefusedException ConnectorInProgressException, ConnectorConnectionRefusedException
from neo.protocol import Packet, ProtocolError, PacketTypes from neo.protocol import PacketTypes
from neo import protocol from neo import protocol
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# 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.
import unittest, os import unittest
from mock import Mock from mock import Mock
from time import time from time import time
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
# 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.
import unittest, os import unittest
from mock import Mock, ReturnValues from mock import Mock
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.handler import EventHandler from neo.handler import EventHandler
from neo.protocol import UnexpectedPacketError from neo.protocol import UnexpectedPacketError
......
...@@ -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.
import unittest, os import unittest
from mock import Mock from mock import Mock
from neo.protocol import NodeStates, CellStates from neo.protocol import NodeStates, CellStates
from neo.pt import Cell, PartitionTable from neo.pt import Cell, PartitionTable
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
import unittest, os import unittest, os
from mock import Mock from mock import Mock
from neo import protocol from neo import protocol
from neo.protocol import *
from neo.protocol import NodeTypes, NodeStates, CellStates from neo.protocol import NodeTypes, NodeStates, CellStates
from neo.protocol import ErrorCodes, PacketTypes from neo.protocol import ErrorCodes, PacketTypes, Packet
from neo.protocol import INVALID_TID, PACKET_HEADER_SIZE
from neo.tests import NeoTestBase from neo.tests import NeoTestBase
from neo.util import getNextTID from neo.util import getNextTID
from time import time, gmtime from time import time, gmtime
......
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