Skip to content

Commit

Permalink
Fix several broken tests that were missing some required positional a…
Browse files Browse the repository at this point in the history
…rguments
  • Loading branch information
Ma27 committed Dec 28, 2019
1 parent a9abf9a commit fe52f0a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/commands/test_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def context(request: FixtureRequest) -> Context:
"""
# Config(path, registration_path, base_path)
config = getattr(request.cls, 'config', Config("", "", ""))
return Context(az=Mock(), config=config, loop=Mock(), session_container=Mock(), bot=Mock())
return Context(az=Mock(), config=config, loop=Mock(), session_container=Mock(), bridge=Mock(), bot=Mock())


@pytest.fixture
Expand All @@ -52,6 +52,7 @@ def test_reply(
sender=u.User(UserID("@sender:example.org")),
command="help",
args=[],
content=Mock(),
is_management=True,
is_portal=False,
)
Expand Down Expand Up @@ -107,6 +108,7 @@ def test_reply_with_cmdprefix(self, command_processor: CommandProcessor, mocker:
sender=u.User(UserID("@sender:example.org")),
command="help",
args=[],
content=Mock(),
is_management=False,
is_portal=False,
)
Expand All @@ -133,6 +135,7 @@ def test_reply_with_cmdprefix_in_management_room(self, command_processor: Comman
sender=u.User(UserID("@sender:example.org")),
command="help",
args=[],
content=Mock(),
is_management=True,
is_portal=False,
)
Expand Down Expand Up @@ -209,6 +212,7 @@ async def test_permissions_denied(
sender=sender,
command=command,
args=[],
content=Mock(),
is_management=False,
is_portal=boolean,
)
Expand Down Expand Up @@ -271,6 +275,7 @@ async def test_permission_granted(
sender=sender,
command=command,
args=[],
content=Mock(),
is_management=is_management,
is_portal=boolean,
)
Expand Down Expand Up @@ -307,6 +312,7 @@ async def test_handle(self, command_processor: CommandProcessor, boolean2: Tuple
sender=sender,
command="hElp",
args=[],
content=Mock(),
is_management=boolean2[0],
is_portal=boolean2[1])

Expand All @@ -333,6 +339,7 @@ async def test_handle_unknown_command(self, command_processor: CommandProcessor,
sender=sender,
command="foo",
args=[],
content=Mock(),
is_management=boolean2[0],
is_portal=boolean2[1],
)
Expand Down Expand Up @@ -361,6 +368,7 @@ async def test_handle_delegated_handler(self, command_processor: CommandProcesso
sender=sender, # u.User
command="foo",
args=[],
content=Mock(),
is_management=boolean2[0],
is_portal=boolean2[1]
)
Expand Down

0 comments on commit fe52f0a

Please sign in to comment.