Skip to content

Commit 421f930

Browse files
committed
Fixed pylint, updated connectionpool & stats changes, added bitmessagemock file & moved mock folder to tests
1 parent b2e39b2 commit 421f930

9 files changed

+9
-11
lines changed
File renamed without changes.

src/tests/mock/bitmessagemock.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main():
2+
pass

src/mock/class_objectProcessor.py renamed to src/tests/mock/class_objectProcessor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def __init__(self):
4343
def run(self):
4444
"""Process the objects from `.queues.objectProcessorQueue`"""
4545
while True:
46+
# pylint: disable=unused-variable
4647
objectType, data = queues.objectProcessorQueue.get()
4748

4849
if state.shutdown:

src/mock/class_singleWorker.py renamed to src/tests/mock/class_singleWorker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class MockSingleWorker(StoppableThread):
1818
def __init__(self):
1919
super(MockSingleWorker, self).__init__(name="singleWorker")
2020
proofofwork.init()
21+
self.busy = None
2122

2223
def stopThread(self):
2324
"""Signal through the queue that the thread should be stopped"""
@@ -35,7 +36,7 @@ def run(self):
3536

3637
while state.shutdown == 0:
3738
self.busy = 0
38-
command, data = queues.workerQueue.get()
39+
command, _ = queues.workerQueue.get()
3940
self.busy = 1
4041
if command == 'stopThread':
4142
self.busy = 0

src/mock/inventory.py renamed to src/tests/mock/inventory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# TODO make this dynamic, and watch out for frozen, like with messagetypes
44
from singleton import Singleton
55

6-
6+
# pylint: disable=old-style-class,too-few-public-methods
77
@Singleton
88
class MockInventory():
99
"""
File renamed without changes.

src/mock/network/connectionpool.py renamed to src/tests/mock/network/connectionpool.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,11 @@
99

1010
logger = logging.getLogger('default')
1111

12-
12+
# pylint: disable=too-few-public-methods
1313
@Singleton
1414
class MockBMConnectionPool(object):
1515
"""Pool of all existing connections"""
1616

1717
def __init__(self):
18-
asyncore.set_rates(
19-
BMConfigParser().safeGetInt(
20-
"bitmessagesettings", "maxdownloadrate"),
21-
BMConfigParser().safeGetInt(
22-
"bitmessagesettings", "maxuploadrate")
23-
)
2418
self.outboundConnections = {}
2519
self.inboundConnections = {}

src/mock/network/stats.py renamed to src/tests/mock/network/stats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"""
44

55

6-
def MockUploadSpeed():
6+
def uploadSpeed():
77
"""Getting upload speed"""
88
return 0
99

1010

11-
def MockDownloadSpeed():
11+
def downloadSpeed():
1212
"""Getting download speed"""
1313
return 0

0 commit comments

Comments
 (0)