Add PR suggestions

This commit is contained in:
zandercymatics 2023-10-25 11:35:41 -06:00
parent a87519e615
commit 91c68f91f1
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
7 changed files with 37 additions and 17 deletions

View file

@ -48,7 +48,7 @@ class Socket:
def send(self, command):
"""Sends a command to the registry.
If the response code is >= 2000,
If the RegistryError code is >= 2000,
then this function raises a LoginError.
The calling function should handle this."""
response = self.client.send(command)
@ -59,7 +59,9 @@ class Socket:
return response
def is_login_error(self, code):
"""Returns the result of code >= 2000"""
"""Returns the result of code >= 2000 for RegistryError.
This indicates that something weird happened on the Registry,
and that we should return a LoginError."""
return code >= 2000
def test_connection_success(self):
@ -90,7 +92,7 @@ class Socket:
# If we encounter a login error, fail
if self.is_login_error(response.code):
logger.warning("was login error")
logger.warning("A login error was found in test_connection_success")
return False
# Otherwise, just return true