mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
Apply pylint's linting rules to bfxapi/tests/*.py.
This commit is contained in:
@@ -19,7 +19,7 @@ disable=
|
||||
|
||||
max-line-length=130
|
||||
|
||||
good-names=id,on
|
||||
good-names=id,on,pl,t,A,B,C,D,E,F
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
|
||||
@@ -17,9 +17,13 @@ class TestNotification(unittest.TestCase):
|
||||
|
||||
notification = _Notification[Test](test)
|
||||
|
||||
self.assertEqual(notification.parse(*[1675787861506, "test", None, None, [ 5, None, 65.0, None, "X" ], 0, "SUCCESS", "This is just a test notification."]),
|
||||
Notification[Test](1675787861506, "test", None, Test(5, 65.0, "X"), 0, "SUCCESS", "This is just a test notification."),
|
||||
msg="_Notification should produce the right notification.")
|
||||
actual = notification.parse(*[ 1675787861506, "test", None, None, [ 5, None, 65.0, None, "X" ], \
|
||||
0, "SUCCESS", "This is just a test notification." ])
|
||||
|
||||
expected = Notification[Test](1675787861506, "test", None, Test(5, 65.0, "X"),
|
||||
0, "SUCCESS", "This is just a test notification.")
|
||||
|
||||
self.assertEqual(actual, expected, msg="_Notification should produce the right notification.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -1,3 +1,5 @@
|
||||
#pylint: disable=duplicate-code
|
||||
|
||||
import unittest
|
||||
|
||||
from ..labeler import _Type
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pylint: disable=duplicate-code
|
||||
|
||||
import unittest
|
||||
|
||||
from ..labeler import _Type
|
||||
|
||||
@@ -31,8 +31,7 @@ class BfxWebsocketBucket:
|
||||
|
||||
self.handler = PublicChannelsHandler(event_emitter=self.event_emitter)
|
||||
|
||||
#pylint: disable-next=unused-argument
|
||||
async def connect(self, index):
|
||||
async def connect(self):
|
||||
reconnection = False
|
||||
|
||||
async for websocket in websockets.connect(self.host):
|
||||
|
||||
@@ -75,7 +75,7 @@ class BfxWebsocketClient:
|
||||
for index in range(connections):
|
||||
self.buckets += [BfxWebsocketBucket(self.host, self.event_emitter, self.on_open_events[index])]
|
||||
|
||||
tasks = [ bucket.connect(index) for index, bucket in enumerate(self.buckets) ]
|
||||
tasks = [ bucket.connect() for bucket in self.buckets ]
|
||||
|
||||
tasks.append(self.__connect())
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pylint: disable=invalid-name,redefined-builtin,too-many-arguments
|
||||
#pylint: disable=redefined-builtin,too-many-arguments
|
||||
|
||||
from decimal import Decimal
|
||||
from datetime import datetime
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#pylint: disable-next=wildcard-import,unused-wildcard-import
|
||||
from typing import *
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from .. labeler import _Type
|
||||
#pylint: disable-next=unused-import
|
||||
from .. notification import Notification
|
||||
|
||||
from .. labeler import _Type
|
||||
|
||||
from ..utils.json_encoder import JSON
|
||||
|
||||
#region Type hinting for Websocket Public Channels
|
||||
|
||||
Reference in New Issue
Block a user