Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxcode committed Jan 5, 2024
1 parent ba01f05 commit c5fe1ef
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/test_client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,17 @@ def setUp(self) -> None:
def test_login(self):
self.__ami_client.login_response = FutureResponseMock(
ResponseMock("Error", True))
self.assertRaises(Exception, self.__client.login, "", "", 1)
self.assertRaises(Exception, self.__client.login, "", "", 1, 1)

self.__ami_client.login_response = FutureResponseMock(
ResponseMock("Error", False))
self.assertRaisesRegex(
Exception,
"Unable to login AMI client",
self.__client.login,
"",
"",
0.01)
self.assertRaisesRegex(Exception, "Unable to login AMI client", self.__client.login, "", "", 0, 0)

self.__ami_client.login_response = FutureResponseMock(
ResponseMock("Success", False))
self.__client._ClientWrapper__is_login_validated = True
self.__client.login("<username>", "<secret>", 0)
self.__client._ClientWrapper__is_asterisk_fully_booted = True
self.__client.login("<username>", "<secret>", 0, 0)

self.assertEqual(self.__ami_client.logged_in_username, "<username>")
self.assertEqual(self.__ami_client.logged_in_secret, "<secret>")
Expand Down

0 comments on commit c5fe1ef

Please sign in to comment.