Commit 6e32ebb7 authored by Julien Muchembled's avatar Julien Muchembled

Fix spelling mistakes

parent b61f8745
......@@ -34,7 +34,7 @@ ZODB API is fully implemented except:
for garbage collection)
- blobs: not implemented (not considered yet)
Any ZODB like FileStorage can be converted to NEO instanteously,
Any ZODB like FileStorage can be converted to NEO instantaneously,
which means the database is operational before all data are imported.
There's also a tool to convert back to FileStorage.
......
......@@ -74,7 +74,7 @@ class AdminEventHandler(EventHandler):
class MasterEventHandler(EventHandler):
""" This class is just used to dispacth message to right handler"""
""" This class is just used to dispatch message to right handler"""
def _connectionLost(self, conn):
app = self.app
......
......@@ -108,7 +108,7 @@ class Storage(BaseStorage.BaseStorage,
def deleteObject(self, oid, serial, transaction):
self.app.store(oid, serial, None, None, transaction)
# mutliple revisions
# multiple revisions
def loadSerial(self, oid, serial):
try:
return self.app.load(oid, serial)[0]
......
......@@ -87,4 +87,4 @@ def patch():
patch()
import app # set up signal handers early enough to do it in the main thread
import app # set up signal handlers early enough to do it in the main thread
......@@ -132,7 +132,7 @@ class Application(ThreadedApplication):
self._cache_lock_acquire = lock.acquire
self._cache_lock_release = lock.release
# _connecting_to_master_node is used to prevent simultaneous master
# node connection attemps
# node connection attempts
self._connecting_to_master_node = Lock()
self.compress = compress
......@@ -324,7 +324,7 @@ class Application(ThreadedApplication):
object existed, but its creation was undone
Note that loadSerial is used during conflict resolution to load
object's current version, which is not visible to us normaly (it was
object's current version, which is not visible to us normally (it was
committed after our snapshot was taken).
"""
# TODO:
......@@ -987,7 +987,7 @@ class Application(ThreadedApplication):
queue = txn_context['queue']
txn_context['object_stored_counter_dict'][oid] = {}
# ZODB.Connection performs calls 'checkCurrentSerialInTransaction'
# after stores, and skips oids that have been succeessfully stored.
# after stores, and skips oids that have been successfully stored.
assert oid not in txn_context['cache_dict'], (oid, txn_context)
txn_context['data_dict'].setdefault(oid, CHECKED_SERIAL)
checked_nodes = txn_context['checked_nodes']
......
......@@ -203,7 +203,7 @@ class ClientCache(object):
item = self._load(oid, next_tid)
if item:
# We don't handle late invalidations for cached oids, because
# the caller is not supposed to explicitely asks for tids after
# the caller is not supposed to explicitly asks for tids after
# app.last_tid (and the cache should be empty when app.last_tid
# is still None).
assert item.tid == tid, (item, tid)
......
......@@ -170,7 +170,7 @@ class StorageAnswersHandler(AnswerBaseHandler):
raise ConflictError, 'Lock wait timeout for oid %s on %r' % (
dump(oid), conn)
# HasLock design required that storage is multi-threaded so that
# it can answer to AskHasLock while processing store resquests.
# it can answer to AskHasLock while processing store requests.
# This means that the 2 cases (granted to us or nobody) are legitimate,
# either because it gave us the lock but is/was slow to store our data,
# or because the storage took a lot of time processing a previous
......
......@@ -72,7 +72,7 @@ class HandlerSwitcher(object):
_pending = self._pending
if self._is_handling:
# If this is called while handling a packet, the response is to
# be excpected for the current handler...
# be expected for the current handler...
(request_dict, _) = _pending[0]
else:
# ...otherwise, queue for the latest handler
......@@ -100,7 +100,7 @@ class HandlerSwitcher(object):
# on_timeout sent a packet with a smaller timeout
# so keep the connection open
return
# Notify that a timeout occured
# Notify that a timeout occurred
return msg_id
def handle(self, connection, packet):
......
......@@ -124,8 +124,8 @@ class SocketConnector(object):
def getDescriptor(self):
# this descriptor must only be used by the event manager, where it
# guarantee unicity only while the connector is opened and registered
# in epoll
# guarantee uniqueness only while the connector is opened and
# registered in epoll
return self.socket_fd
@staticmethod
......
......@@ -12,7 +12,7 @@ from Queue import Empty
Python threading module contains a simple logging mechanism, but:
- It's limitted to RLock class
- It's enabled instance by instance
- Choice to log or not is done at instanciation
- Choice to log or not is done at instantiation
- It does not emit any log before trying to acquire lock
This file defines a VerboseLock class implementing basic lock API and
......@@ -29,7 +29,7 @@ class LockUser(object):
def __init__(self, message, level=0):
t = threading.currentThread()
ident = getattr(t, 'node_name', t.name)
# This class is instanciated from a place desiring to known what
# This class is instantiated from a place desiring to known what
# called it.
# limit=1 would return execution position in this method
# limit=2 would return execution position in caller
......
......@@ -227,7 +227,7 @@ class Node(object):
self.setState(NodeStates.PENDING)
def asTuple(self):
""" Returned tuple is intented to be used in procotol encoders """
""" Returned tuple is intended to be used in protocol encoders """
return (self.getType(), self._address, self._uuid, self._state)
def __gt__(self, node):
......@@ -337,7 +337,7 @@ class NodeManager(object):
def __init__(self, master_db=None):
"""
master_db (string)
Path to a file containing master nodes's addresses. Used to automate
Path to a file containing master nodes' addresses. Used to automate
master list updates. If not provided, no automation will happen.
"""
self._node_set = set()
......@@ -583,7 +583,7 @@ class NodeManager(object):
'Discrepancy between node_by_uuid (%r) and ' \
'node_by_addr (%r)' % (node_by_uuid, node_by_addr)
if state == NodeStates.DOWN:
logging.debug('droping node %r (%r), found with %s '
logging.debug('dropping node %r (%r), found with %s '
'%s %s %s', node, node.isConnected(), *log_args)
if node.isConnected():
# Cut this connection, node removed by handler.
......
......@@ -16,7 +16,7 @@
#
def speedupFileStorageTxnLookup():
"""Speed up lookup of start position when instanciating an iterator
"""Speed up lookup of start position when instantiating an iterator
FileStorage does not index the file positions of transactions.
With this patch, we use the existing {oid->file_pos} index to bisect the
......
......@@ -329,7 +329,7 @@ class ParseError(Exception):
class PItem(object):
"""
Base class for any packet item, _encode and _decode must be overriden
Base class for any packet item, _encode and _decode must be overridden
by subclasses.
"""
def __init__(self, name):
......@@ -1491,8 +1491,8 @@ class Replicate(Packet):
class ReplicationDone(Packet):
"""
Notify the master node that a partition has been successully replicated from
a storage to another.
Notify the master node that a partition has been successfully replicated
from a storage to another.
S -> M
"""
_fmt = PStruct('notify_replication_done',
......@@ -1527,7 +1527,7 @@ def register(request, ignore_when_closed=None):
# By default, on a closed connection:
# - request: ignore
# - answer: keep
# - nofitication: keep
# - notification: keep
ignore_when_closed = answer is not None
request._ignore_when_closed = ignore_when_closed
if answer in (Error, None):
......@@ -1564,7 +1564,7 @@ class ParserState(object):
class Packets(dict):
"""
Packet registry that check packet code unicity and provide an index
Packet registry that checks packet code uniqueness and provides an index
"""
def __metaclass__(name, base, d):
for k, v in d.iteritems():
......
......@@ -150,7 +150,7 @@ class ThreadedApplication(BaseApplication):
if msg_id == qpacket.getId():
if is_forgotten:
raise ValueError, 'ForgottenPacket for an ' \
'explicitely expected packet.'
'explicitly expected packet.'
_handlePacket(qconn, qpacket, kw, handler)
break
if not is_forgotten and qpacket is not None:
......
......@@ -142,7 +142,7 @@ def parseNodeAddress(address, port_opt=None):
else:
host = address
port = port_opt
# Resolve (maybe) and cast to cannonical form
# Resolve (maybe) and cast to canonical form
# XXX: Always pick the first result. This might not be what is desired, and
# if so this function should either take a hint on the desired address type
# or return either raw host & port or getaddrinfo return value.
......
......@@ -40,7 +40,7 @@ from .verification import VerificationManager
class Application(BaseApplication):
"""The master node application."""
packing = None
# Latest completely commited TID
# Latest completely committed TID
last_transaction = ZERO_TID
backup_tid = None
backup_app = None
......@@ -261,7 +261,7 @@ class Application(BaseApplication):
def provideService(self):
"""
This is the normal mode for a primary master node. Handle transactions
and stop the service only if a catastrophy happens or the user commits
and stop the service only if a catastrophe happens or the user commits
a shutdown.
"""
logging.info('provide service')
......@@ -298,7 +298,7 @@ class Application(BaseApplication):
# secondaries, rather than the other way around. This requires
# a bit more work when a new master joins a cluster but makes
# it easier to resolve UUID conflicts with minimal cluster
# impact, and ensure primary master unicity (primary masters
# impact, and ensure primary master uniqueness (primary masters
# become noisy, in that they actively try to maintain
# connections to all other master nodes, so duplicate
# primaries will eventually get in touch with each other and
......
......@@ -51,7 +51,7 @@ class PrimaryHandler(EventHandler):
app = self.app
addr = conn.getAddress()
node = app.nm.getByAddress(addr)
# connection successfull, set it as running
# connection successful, set it as running
node.setRunning()
conn.ask(Packets.RequestIdentification(
NodeTypes.MASTER,
......
......@@ -334,7 +334,7 @@ class TransactionManager(object):
"""
Set that a node has locked the transaction.
If transaction is completely locked, calls function given at
instanciation time.
instantiation time.
"""
logging.debug('Lock TXN %s for %s', dump(ttid), uuid_str(uuid))
if self[ttid].lock(uuid) and self._queue[0] == ttid:
......
......@@ -174,7 +174,7 @@ class TerminalNeoCTL(object):
def tweakPartitionTable(self, params):
"""
Optimize partition table.
No partitition will be assigned to specified storage nodes.
No partition will be assigned to specified storage nodes.
Parameters: [node [...]]
"""
return self.neoctl.tweakPartitionTable(map(self.asNode, params))
......@@ -294,7 +294,7 @@ class Application(object):
if docstring is None:
docstring = '(no docstring)'
docstring_line_list = docstring.split('\n')
# Strip empty lines at begining & end of line list
# Strip empty lines at beginning & end of line list
for end in (0, -1):
while len(docstring_line_list) \
and docstring_line_list[end] == '':
......
......@@ -43,7 +43,7 @@ def main(args=None):
# TODO: Forbid using "reset" along with any unneeded argument.
# "reset" is too dangerous to let user a chance of accidentally
# letting it slip through in a long option list.
# We should drop support configation files to make such check useful.
# We should drop support configuration files to make such check useful.
(options, args) = parser.parse_args(args=args)
config = ConfigurationManager(defaults, options, 'storage')
......
......@@ -76,7 +76,7 @@ class DatabaseManager(object):
@abstract
def _parse(self, database):
"""Called during instanciation, to process database parameter."""
"""Called during instantiation, to process database parameter."""
def setup(self, reset=0):
"""Set up a database, discarding existing data first if reset is True
......@@ -92,7 +92,7 @@ class DatabaseManager(object):
@abstract
def _setup(self):
"""To be overriden by the backend to set up a database
"""To be overridden by the backend to set up a database
It must recover self._uncommitted_data from temporary object table.
_uncommitted_data is already instantiated and must be updated with
......@@ -411,7 +411,7 @@ class DatabaseManager(object):
@abstract
def _pruneData(self, data_id_list):
"""To be overriden by the backend to delete any unreferenced data
"""To be overridden by the backend to delete any unreferenced data
'unreferenced' means:
- not in self._uncommitted_data
......@@ -421,7 +421,7 @@ class DatabaseManager(object):
@abstract
def storeData(self, checksum, data, compression):
"""To be overriden by the backend to store object raw data
"""To be overridden by the backend to store object raw data
If same data was already stored, the storage only has to check there's
no hash collision.
......@@ -485,7 +485,7 @@ class DatabaseManager(object):
tid
Transation doing the undo
ltid
Upper (exclued) bound of transactions visible to transaction doing
Upper (excluded) bound of transactions visible to transaction doing
the undo.
undone_tid
Transaction to undo
......@@ -636,7 +636,7 @@ class DatabaseManager(object):
@abstract
def checkTIDRange(self, partition, length, min_tid, max_tid):
"""
Generate a diggest from transaction list.
Generate a digest from transaction list.
min_tid (packed)
TID at which verification starts.
length (int)
......@@ -653,7 +653,7 @@ class DatabaseManager(object):
@abstract
def checkSerialRange(self, partition, length, min_tid, max_tid, min_oid):
"""
Generate a diggest from object list.
Generate a digest from object list.
min_oid (packed)
OID at which verification starts.
min_tid (packed)
......
......@@ -216,7 +216,7 @@ class MySQLDatabaseManager(DatabaseManager):
engine += " compression='tokudb_uncompressed'"
# The table "data" stores object data.
# We'd like to have partial index on 'hash' colum (e.g. hash(4))
# We'd like to have partial index on 'hash' column (e.g. hash(4))
# but 'UNIQUE' constraint would not work as expected.
q("""CREATE TABLE IF NOT EXISTS data (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
......@@ -630,7 +630,7 @@ class MySQLDatabaseManager(DatabaseManager):
return oid_list, user, desc, ext, bool(packed), util.p64(ttid)
def getObjectHistory(self, oid, offset, length):
# FIXME: This method doesn't take client's current ransaction id as
# FIXME: This method doesn't take client's current transaction id as
# parameter, which means it can return transactions in the future of
# client's transaction.
oid = util.u64(oid)
......
......@@ -88,7 +88,7 @@ class ClientOperationHandler(EventHandler):
except DelayedError:
# locked by a previous transaction, retry later
# If we are unlocking, we want queueEvent to raise
# AlreadyPendingError, to avoid making lcient wait for an unneeded
# AlreadyPendingError, to avoid making client wait for an unneeded
# response.
try:
self.app.queueEvent(self._askStoreObject, conn, (oid, serial,
......
......@@ -29,7 +29,7 @@ class InitializationHandler(BaseMasterHandler):
pt.load(ptid, row_list, self.app.nm)
if not pt.filled():
raise ProtocolError('Partial partition table received')
# Install the partition table into the database for persistency.
# Install the partition table into the database for persistence.
cell_list = []
num_partitions = pt.getPartitions()
unassigned_set = set(xrange(num_partitions))
......
......@@ -336,7 +336,7 @@ class Replicator(object):
offset, message and ' (%s)' % message)
if offset in self.partition_dict:
# XXX: Try another partition if possible, to increase probability to
# connect to another node. It would be better to explicitely
# connect to another node. It would be better to explicitly
# search for another node instead.
tid = self.replicate_dict.pop(offset, None) or self.replicate_tid
if self.replicate_dict:
......
......@@ -312,7 +312,7 @@ class NeoUnitTestBase(NeoTestBase):
self.assertRaises(protocol.ProtocolError, method, *args, **kwargs)
def checkUnexpectedPacketRaised(self, method, *args, **kwargs):
""" Check if the UnexpectedPacketError exception wxas raised """
""" Check if the UnexpectedPacketError exception was raised """
self.assertRaises(protocol.UnexpectedPacketError, method, *args, **kwargs)
def checkIdenficationRequired(self, method, *args, **kwargs):
......@@ -320,11 +320,11 @@ class NeoUnitTestBase(NeoTestBase):
self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNodeDisallowedError exception wxas raised """
""" Check if the BrokenNodeDisallowedError exception was raised """
self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
def checkNotReadyErrorRaised(self, method, *args, **kwargs):
""" Check if the NotReadyError exception wxas raised """
""" Check if the NotReadyError exception was raised """
self.assertRaises(protocol.NotReadyError, method, *args, **kwargs)
def checkAborted(self, conn):
......@@ -372,7 +372,7 @@ class NeoUnitTestBase(NeoTestBase):
self.assertEqual(found_uuid, uuid)
# in check(Ask|Answer|Notify)Packet we return the packet so it can be used
# in tests if more accurates checks are required
# in tests if more accurate checks are required
def checkErrorPacket(self, conn, decode=False):
""" Check if an error packet was answered """
......
......@@ -81,7 +81,7 @@ class ClientApplicationTests(NeoUnitTestBase):
# stop threads
for app in self._to_stop_list:
app.close()
# restore environnement
# restore environment
Application._ask = self._ask
Application._getMasterConnection = self._getMasterConnection
NeoUnitTestBase._tearDown(self, success)
......@@ -596,7 +596,7 @@ class ClientApplicationTests(NeoUnitTestBase):
Object oid previous revision before tid1 is tid0.
Transaction tid2 modified oid (and contains its data).
Undo is rejeced with a raise, because conflict resolution fails.
Undo is rejected with a raise, because conflict resolution fails.
"""
oid0 = self.makeOID(1)
tid0 = self.getNextTID()
......@@ -795,7 +795,7 @@ class ClientApplicationTests(NeoUnitTestBase):
ask_func_list.pop(0)(conn)
app.nm.getByAddress(conn.getAddress())._connection = None
app._ask = _ask_base
# faked environnement
# fake environment
app.em.close()
app.em = Mock({'getConnectionList': []})
app.pt = Mock({ 'operational': False})
......@@ -831,11 +831,11 @@ class ClientApplicationTests(NeoUnitTestBase):
self.assertTrue(self.test_ok)
# check NEOStorageError is raised when the primary connection is lost
app.master_conn = None
# check disabled since we reonnect to pmn
# check disabled since we reconnect to pmn
#self.assertRaises(NEOStorageError, app._askPrimary, packet)
def test_threadContextIsolation(self):
""" Thread context properties must not be visible accross instances
""" Thread context properties must not be visible across instances
while remaining in the same thread """
app1 = self.getApp()
app1_local = app1._thread_container
......
......@@ -183,7 +183,7 @@ class NEOProcess(object):
self.wait()
except:
# We can ignore all exceptions at this point, since there is no
# garanteed way to handle them (other objects we would depend on
# guaranteed way to handle them (other objects we would depend on
# might already have been deleted).
pass
......@@ -565,7 +565,7 @@ class NEOCluster(object):
def callback(last_try):
current_try = self.getPrimary()
if None not in (uuid, current_try) and uuid != current_try:
raise AssertionError, 'An unexpected primary arised: %r, ' \
raise AssertionError, 'An unexpected primary arose: %r, ' \
'expected %r' % (dump(current_try), dump(uuid))
return uuid is None or uuid == current_try, current_try
self.expectCondition(callback, *args, **kw)
......
......@@ -43,7 +43,7 @@ class Tree(Persistent):
self.left = Tree(depth)
# simple persitent object with conflict resolution
# simple persistent object with conflict resolution
class PCounter(Persistent):
_value = 0
......@@ -131,7 +131,7 @@ class ClientTests(NEOFunctionalTest):
c2.root()['other']
c1.root()['item'] = 1
t1.commit()
# load objet from zope cache
# load object from zope cache
self.assertEqual(c1.root()['item'], 1)
self.assertEqual(c2.root()['item'], 0)
......@@ -334,7 +334,7 @@ class ClientTests(NEOFunctionalTest):
t3.user = 'user'
t3.description = 'desc'
st3.tpc_begin(t3)
# retreive the last revision
# retrieve the last revision
data, serial = st3.load(oid)
# try to store again, should not be delayed
st3.store(oid, serial, data, '', t3)
......
......@@ -63,7 +63,7 @@ class MasterTests(NEOFunctionalTest):
# BUG: The following check expects neoctl to reconnect before
# the election finishes.
self.assertEqual(self.neo.getPrimary(), None)
# Check that a primary master arised.
# Check that a primary master arose.
self.neo.expectPrimary(timeout=10)
# Check that the uuid really changed.
new_uuid = self.neo.getPrimary()
......@@ -83,7 +83,7 @@ class MasterTests(NEOFunctionalTest):
uuid, = self.neo.killPrimary()
# Check the state of the primary we just killed
self.neo.expectMasterState(uuid, (None, NodeStates.UNKNOWN))
# Check that a primary master arised.
# Check that a primary master arose.
self.neo.expectPrimary(timeout=10)
# Check that the uuid really changed.
self.assertNotEqual(self.neo.getPrimary(), uuid)
......
......@@ -69,7 +69,7 @@ class StorageTests(NEOFunctionalTest):
def __checkDatabase(self, db_name):
db = self.neo.getSQLConnection(db_name)
# wait for the sql transaction to be commited
# wait for the sql transaction to be committed
def callback(last_try):
db.commit() # to get a fresh view
# One revision per object and two for the root, before and after
......@@ -185,7 +185,7 @@ class StorageTests(NEOFunctionalTest):
def testVerificationTriggered(self):
""" Check that the verification stage is executed when a storage node
required to be operationnal is lost, and the cluster come back in
required to be operational is lost, and the cluster come back in
running state when the storage is up again """
# start neo with one storages
......
......@@ -225,7 +225,7 @@ class MasterServerElectionTests(MasterClientElectionTestBase):
def _tearDown(self, success):
NeoUnitTestBase._tearDown(self, success)
# restore environnement
# restore environment
del ClientConnection._addPacket
def test_requestIdentification1(self):
......
......@@ -160,7 +160,7 @@ class MasterStorageHandlerTests(NeoUnitTestBase):
self.assertEqual(lptid, self.app.pt.getID())
def test_answerPack(self):
# Note: incomming status has no meaning here, so it's left to False.
# Note: incoming status has no meaning here, so it's left to False.
node1, conn1 = self._getStorage()
node2, conn2 = self._getStorage()
self.app.packing = None
......
......@@ -169,7 +169,7 @@ class testTransactionManager(NeoUnitTestBase):
"""
Transaction lock is present to ensure invalidation TIDs are sent in
strictly increasing order.
Note: this implementation might change later, to allow more paralelism.
Note: this implementation might change later, for more parallelism.
"""
client_uuid, client = self.makeNode(NodeTypes.CLIENT)
tm = TransactionManager(lambda tid, txn: None)
......
......@@ -167,17 +167,17 @@ class StorageDBTests(NeoUnitTestBase):
self.assertEqual(self.db.getObject(oid1), None)
self.assertEqual(self.db.getObject(oid1, tid1), None)
self.assertEqual(self.db.getObject(oid1, before_tid=tid1), None)
# one non-commited version
# one non-committed version
with self.commitTransaction(tid1, objs1, txn1):
self.assertEqual(self.db.getObject(oid1), None)
self.assertEqual(self.db.getObject(oid1, tid1), None)
self.assertEqual(self.db.getObject(oid1, before_tid=tid1), None)
# one commited version
# one committed version
self.assertEqual(self.db.getObject(oid1), OBJECT_T1_NO_NEXT)
self.assertEqual(self.db.getObject(oid1, tid1), OBJECT_T1_NO_NEXT)
self.assertEqual(self.db.getObject(oid1, before_tid=tid1),
FOUND_BUT_NOT_VISIBLE)
# two version available, one non-commited
# two version available, one non-committed
with self.commitTransaction(tid2, objs2, txn2):
self.assertEqual(self.db.getObject(oid1), OBJECT_T1_NO_NEXT)
self.assertEqual(self.db.getObject(oid1, tid1), OBJECT_T1_NO_NEXT)
......@@ -187,7 +187,7 @@ class StorageDBTests(NeoUnitTestBase):
FOUND_BUT_NOT_VISIBLE)
self.assertEqual(self.db.getObject(oid1, before_tid=tid2),
OBJECT_T1_NO_NEXT)
# two commited versions
# two committed versions
self.assertEqual(self.db.getObject(oid1), OBJECT_T2)
self.assertEqual(self.db.getObject(oid1, tid1), OBJECT_T1_NEXT)
self.assertEqual(self.db.getObject(oid1, before_tid=tid1),
......
......@@ -187,7 +187,7 @@ class TransactionManagerTests(NeoUnitTestBase):
ttid1, serial, *obj)
def testResolvableConflict(self):
""" Try to store an object with the lastest revision """
""" Try to store an object with the latest revision """
uuid = self.getClientUUID()
tid, txn = self._getTransaction()
serial, obj = self._getObject(1)
......
......@@ -330,7 +330,7 @@ class HandlerSwitcherTests(NeoUnitTestBase):
r2 = self._makeRequest(2)
a2 = self._makeAnswer(2)
h = self._makeHandler()
# emit requests aroung state setHandler
# emit requests around state setHandler
self._handlers.emit(r1, 0, None)
applied = self._handlers.setHandler(h)
self.assertFalse(applied)
......
......@@ -301,7 +301,7 @@ class MasterDBTests(NeoUnitTestBase):
def testInitialAccessRights(self):
"""
Verify MasterDB raises immediately on instanciation if it cannot
Verify MasterDB raises immediately on instantiation if it cannot
create a non-existing database. This does not guarantee any later
open will succeed, but makes the simple error case obvious.
"""
......
......@@ -65,9 +65,9 @@ class PartitionTableTests(NeoUnitTestBase):
self.assertEqual(cell.getState(), CellStates.UP_TO_DATE)
else:
self.assertEqual(len(pt.partition_list[x]), 0)
# try to add to an unexistant partition
# try to add to a nonexistent partition
self.assertRaises(IndexError, pt.setCell, 10, sn1, CellStates.UP_TO_DATE)
# if we add in discardes state, must be removed
# if we add in discards state, must be removed
pt.setCell(0, sn1, CellStates.DISCARDED)
for x in xrange(num_partitions):
self.assertEqual(len(pt.partition_list[x]), 0)
......@@ -168,7 +168,7 @@ class PartitionTableTests(NeoUnitTestBase):
num_partitions = 5
num_replicas = 2
pt = PartitionTable(num_partitions, num_replicas)
# add two kind of node, usable and unsable
# add two kind of node, usable and unusable
uuid1 = self.getStorageUUID()
server1 = ("127.0.0.1", 19001)
sn1 = StorageNode(Mock(), server1, uuid1)
......@@ -214,7 +214,7 @@ class PartitionTableTests(NeoUnitTestBase):
num_partitions = 5
num_replicas = 2
pt = PartitionTable(num_partitions, num_replicas)
# add two kind of node, usable and unsable
# add two kind of node, usable and unusable
uuid1 = self.getStorageUUID()
server1 = ("127.0.0.1", 19001)
sn1 = StorageNode(Mock(), server1, uuid1)
......@@ -244,7 +244,7 @@ class PartitionTableTests(NeoUnitTestBase):
num_partitions = 5
num_replicas = 2
pt = PartitionTable(num_partitions, num_replicas)
# add two kind of node, usable and unsable
# add two kind of node, usable and unusable
uuid1 = self.getStorageUUID()
server1 = ("127.0.0.1", 19001)
sn1 = StorageNode(Mock(), server1, uuid1)
......@@ -286,7 +286,7 @@ class PartitionTableTests(NeoUnitTestBase):
num_partitions = 5
num_replicas = 2
pt = PartitionTable(num_partitions, num_replicas)
# add two kind of node, usable and unsable
# add two kind of node, usable and unusable
uuid1 = self.getStorageUUID()
server1 = ("127.0.0.1", 19001)
sn1 = StorageNode(Mock(), server1, uuid1)
......@@ -294,7 +294,7 @@ class PartitionTableTests(NeoUnitTestBase):
# now test
self.assertTrue(pt.hasOffset(0))
self.assertFalse(pt.hasOffset(1))
# unknonw partition
# unknown partition
self.assertFalse(pt.hasOffset(50))
def test_10_operational(self):
......@@ -397,7 +397,7 @@ class PartitionTableTests(NeoUnitTestBase):
self.assertEqual(len(row_3), 0)
row_4 = pt.getRow(4)
self.assertEqual(len(row_4), 0)
# unknwon row
# unknown row
self.assertRaises(IndexError, pt.getRow, 5)
if __name__ == '__main__':
......
......@@ -22,7 +22,7 @@ from neo.lib.util import ReadBuffer, parseNodeAddress
class UtilTests(NeoUnitTestBase):
def test_parseNodeAddress(self):
""" Parsing of addesses """
""" Parsing of addresses """
def test(parsed, *args):
self.assertEqual(parsed, parseNodeAddress(*args))
http_port = socket.getservbyname('http')
......
......@@ -970,7 +970,7 @@ class Test(NEOThreadedTest):
self.assertFalse(storage.tm._transaction_dict)
finally:
db.close()
# Check we did't get an invalidation, which would cause an
# Check we didn't get an invalidation, which would cause an
# assertion failure in the cache. Connection does the same check in
# _setstate_noncurrent so this could be also done by starting a
# transaction before the last one, and clearing the cache before
......
......@@ -242,7 +242,7 @@ class ReplicationTests(NEOThreadedTest):
More generally, this checks that when a handler raises when a connection
is closed voluntarily, the connection is in a consistent state and can
be, for example, closed again after the exception is catched, without
be, for example, closed again after the exception is caught, without
assertion failure.
"""
conn, = backup.master.getConnectionList(backup.upstream.master)
......
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