Fixed pylint, updated connectionpool & stats changes, added bitmessagemock file & moved mock folder to tests

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-12-02 21:45:37 +05:30
parent ed1c8ca100
commit 3cc49da6f1
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A
9 changed files with 9 additions and 11 deletions

View File

@ -0,0 +1,2 @@
def main():
pass

View File

@ -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:

View File

@ -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

View File

@ -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():
"""

View File

@ -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 = {}

View File

@ -3,11 +3,11 @@ Network statistics
"""
def MockUploadSpeed():
def uploadSpeed():
"""Getting upload speed"""
return 0
def MockDownloadSpeed():
def downloadSpeed():
"""Getting download speed"""
return 0