Skip to content

Commit

Permalink
remove redundant imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahad-10 committed May 23, 2024
1 parent dbc7d5c commit 33cd6f3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
7 changes: 3 additions & 4 deletions tests/messages/test_hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,12 @@ def test_parse_with_invalid_realm_and_details():

expected_errors = [
"HELLO: value at index 1 must be of type 'string' but was dict",
"HELLO: value at index 2 must be of type 'string' but was int",
"HELLO: value at index 2 must be of type 'string' but was list",
"HELLO: value at index 2 for key 'authid' must be of type 'string' but was int",
"HELLO: value at index 2 for key 'authrole' must be of type 'string' but was list",
"HELLO: value at index 2 for key 'roles' must be of type 'dict' but was NoneType",
]

print(str(exc_info.value))
# assert str(exc_info.value) == str(ValueError(*expected_errors))
assert str(exc_info.value) == str(ValueError(*expected_errors))


def test_parse_with_invalid_details_dict_key():
Expand Down
7 changes: 4 additions & 3 deletions tests/messages/test_welcome.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest

from wampproto.messages import util
from wampproto.messages import exceptions
from wampproto.messages.welcome import Welcome

TEST_SESSION_ID = 25631
Expand Down Expand Up @@ -299,7 +298,8 @@ def test_parse_with_empty_role():

assert (
str(exc_info.value)
== f"{Welcome.TEXT}: value at index 2 for roles key must be in {util.AllowedRoles.get_allowed_roles()} but was empty"
== f"{Welcome.TEXT}: value at index 2 for roles key must be in {util.AllowedRoles.get_allowed_roles()} "
f"but was empty"
)


Expand All @@ -310,7 +310,8 @@ def test_parse_with_invalid_role_key():

assert (
str(exc_info.value)
== f"{Welcome.TEXT}: value at index 2 for roles key must be in {util.AllowedRoles.get_allowed_roles()} but was new_role"
== f"{Welcome.TEXT}: value at index 2 for roles key must be in {util.AllowedRoles.get_allowed_roles()} "
f"but was new_role"
)


Expand Down
2 changes: 1 addition & 1 deletion wampproto/messages/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Any

from wampproto.messages import util, exceptions
from wampproto.messages import util
from wampproto.messages.message import Message
from wampproto.messages.validation_spec import ValidationSpec

Expand Down
2 changes: 1 addition & 1 deletion wampproto/messages/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Any

from wampproto.messages import util, exceptions
from wampproto.messages import util
from wampproto.messages.message import Message
from wampproto.messages.validation_spec import ValidationSpec

Expand Down

0 comments on commit 33cd6f3

Please sign in to comment.