Skip to content

Commit

Permalink
Troubleshooting test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed May 31, 2024
1 parent 6111fe9 commit 6ed0eed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 2 additions & 4 deletions neon_utils/skills/kiosk_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ def stop(self):
if user in self._active_users:
self.end_interaction(message)

def _on_event_error(self, error, message, handler_info,
skill_data, speak_errors):
def _on_event_error(self, error, message, *args, **kwargs):
"""
Override error handling to speak custom exception for active sessions
"""
Expand All @@ -208,5 +207,4 @@ def _on_event_error(self, error, message, handler_info,
LOG.exception(error)
self.handle_error(message)
else:
super()._on_event_error(error, message, handler_info,
skill_data, speak_errors)
super()._on_event_error(error, message, *args, **kwargs)
10 changes: 6 additions & 4 deletions tests/net_util_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

TCP_TEST = "mq.neonaiservices.com"


class NetUtilTests(unittest.TestCase):
@classmethod
Expand Down Expand Up @@ -119,18 +121,18 @@ def mock_socket(*args, **kwargs):
def test_check_url_connection_invalid_url(self):
from neon_utils.net_utils import check_url_response

self.assertFalse(check_url_response("https://api.neon.ai"))
self.assertFalse(check_url_response(f"https://{TCP_TEST}"))

def test_check_online_valid_online(self):
from neon_utils.net_utils import check_online
self.assertTrue(check_online())
self.assertTrue(check_online(("google.com", "github.com")))
self.assertTrue(check_online(("api.neon.ai", "google.com")))
self.assertTrue(check_online((TCP_TEST, "google.com")))
self.assertTrue(check_online(("", "google.com")))

def test_check_online_invalid_offline(self):
from neon_utils.net_utils import check_online
self.assertFalse(check_online(("api.neon.ai",)))
self.assertFalse(check_online((TCP_TEST,)))
self.assertFalse(check_online(("",)))

def test_check_online_valid_offline(self):
Expand All @@ -152,7 +154,7 @@ def test_check_online_invalid_params(self):

def test_check_port_is_open(self):
from neon_utils.net_utils import check_port_is_open
self.assertTrue(check_port_is_open("api.neon.ai", 5672))
self.assertTrue(check_port_is_open(TCP_TEST, 5672))
self.assertFalse(check_port_is_open("www.neon.ai", 5672))


Expand Down

0 comments on commit 6ed0eed

Please sign in to comment.