Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxcode committed Jan 8, 2024
1 parent b0b20bc commit d376e71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions test/test_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class EventMock():
@dataclass
class ResponseMock():
status: str
keys: Dict[str, str]


@dataclass
Expand Down Expand Up @@ -134,7 +135,7 @@ def test__attach_event_filter(self) -> None:
def test__send_action(self) -> None:
# Test general AMI error
self.__client_mock.send_action_result = FutureResponseMock(
ResponseMock("error"))
ResponseMock("error", {"Message": "Some error"}))
result = self.__ae._ActionExecuter__send_action()
self.assertFalse(result, "Expected result to be false")

Expand All @@ -145,7 +146,7 @@ def test__send_action(self) -> None:

# Test successful action
self.__client_mock.send_action_result = FutureResponseMock(
ResponseMock("Success"))
ResponseMock("Success", {"Message": "Success"}))
result = self.__ae._ActionExecuter__send_action()
self.assertTrue(result, "Expected result to be true")

Expand Down
5 changes: 2 additions & 3 deletions test/test_client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ def test_login(self):

self.__ami_client.login_response = FutureResponseMock(
ResponseMock("Error", False))
self.assertRaisesRegex(
Exception,
"Unable to login AMI client",
self.assertRaises(
SystemExit,
self.__client.login,
"",
"",
Expand Down

0 comments on commit d376e71

Please sign in to comment.