-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: tests and styles #74
Conversation
Kudos, SonarCloud Quality Gate passed! |
@@ -61,6 +62,8 @@ async def negotiate(self, **kwargs): | |||
await self._proxy.send(struct.pack('3B', 5, 1, 0)) | |||
resp = await self._proxy.recv(2) | |||
|
|||
if not isinstance(resp, (bytes, str)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you encountered any issues here?
Because the response comes from the python build-in asyncio.StreamReader
, it should return the bytes object.
@@ -92,6 +95,9 @@ async def negotiate(self, **kwargs): | |||
|
|||
await self._proxy.send(struct.pack('>2BH5B', 4, 1, port, *bip, 0)) | |||
resp = await self._proxy.recv(8) | |||
if isinstance(resp, asyncio.Future): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you encountered any issues here?
Because the response comes from asyncio
and it should only possibly be the Future
object.
@@ -58,6 +58,8 @@ def get_all_ip(page): | |||
|
|||
def get_status_code(resp, start=9, stop=12): | |||
try: | |||
if not isinstance(resp, (bytes, str)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the viewpoint to check the external argument is acceptable, but the resp in this module should be all bytes object, and what I would like to know is there any edge case happened?
@@ -44,13 +44,13 @@ def test_base_attrs(proxy, ngtr, check_anon_lvl, use_full_path): | |||
( | |||
'SOCKS5', | |||
80, | |||
future_iter(b'\x05\x00', b'\x05\x00\x00\x01\xc0\xa8\x00\x18\xce\xdf'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to remove this? And so does all operation in tests
folder
@bluet i'm not really in the context, it's been a while, but let's give it a try |
Since the PR mainly revise the |
Awesome 👍 |
port to python >=3.8
deprecate <3.8