Fixed pylint, updated connectionpool & stats changes, added bitmessagemock file & moved mock folder to tests
This commit is contained in:
parent
ed1c8ca100
commit
3cc49da6f1
2
src/tests/mock/bitmessagemock.py
Normal file
2
src/tests/mock/bitmessagemock.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
def main():
|
||||
pass
|
|
@ -43,6 +43,7 @@ class objectProcessor(threading.Thread):
|
|||
def run(self):
|
||||
"""Process the objects from `.queues.objectProcessorQueue`"""
|
||||
while True:
|
||||
# pylint: disable=unused-variable
|
||||
objectType, data = queues.objectProcessorQueue.get()
|
||||
|
||||
if state.shutdown:
|
|
@ -18,6 +18,7 @@ class MockSingleWorker(StoppableThread):
|
|||
def __init__(self):
|
||||
super(MockSingleWorker, self).__init__(name="singleWorker")
|
||||
proofofwork.init()
|
||||
self.busy = None
|
||||
|
||||
def stopThread(self):
|
||||
"""Signal through the queue that the thread should be stopped"""
|
||||
|
@ -35,7 +36,7 @@ class MockSingleWorker(StoppableThread):
|
|||
|
||||
while state.shutdown == 0:
|
||||
self.busy = 0
|
||||
command, data = queues.workerQueue.get()
|
||||
command, _ = queues.workerQueue.get()
|
||||
self.busy = 1
|
||||
if command == 'stopThread':
|
||||
self.busy = 0
|
|
@ -3,7 +3,7 @@
|
|||
# TODO make this dynamic, and watch out for frozen, like with messagetypes
|
||||
from singleton import Singleton
|
||||
|
||||
|
||||
# pylint: disable=old-style-class,too-few-public-methods
|
||||
@Singleton
|
||||
class MockInventory():
|
||||
"""
|
|
@ -9,17 +9,11 @@ from singleton import Singleton
|
|||
|
||||
logger = logging.getLogger('default')
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
@Singleton
|
||||
class MockBMConnectionPool(object):
|
||||
"""Pool of all existing connections"""
|
||||
|
||||
def __init__(self):
|
||||
asyncore.set_rates(
|
||||
BMConfigParser().safeGetInt(
|
||||
"bitmessagesettings", "maxdownloadrate"),
|
||||
BMConfigParser().safeGetInt(
|
||||
"bitmessagesettings", "maxuploadrate")
|
||||
)
|
||||
self.outboundConnections = {}
|
||||
self.inboundConnections = {}
|
|
@ -3,11 +3,11 @@ Network statistics
|
|||
"""
|
||||
|
||||
|
||||
def MockUploadSpeed():
|
||||
def uploadSpeed():
|
||||
"""Getting upload speed"""
|
||||
return 0
|
||||
|
||||
|
||||
def MockDownloadSpeed():
|
||||
def downloadSpeed():
|
||||
"""Getting download speed"""
|
||||
return 0
|
Reference in New Issue
Block a user