Skip to content

Commit

Permalink
Update pusher_tests/test_util.py
Browse files Browse the repository at this point in the history
Co-authored-by: Evgenii Breikin <evgenii.breikin@bird.com>
  • Loading branch information
andersonrocha0 and evgeniibreikin authored Jan 18, 2025
1 parent eb5ba53 commit 1ac47dc
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pusher_tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ def test_validate_channel(self):
pusher.util.validate_channel(invalid_channel)

def test_validate_server_to_user_channel(self):
self.assertEqual("#server-to-user-123", pusher.util.validate_channel("#server-to-user-123"))
self.assertEqual("#server-to-user-user123", pusher.util.validate_channel("#server-to-user-user123"))
self.assertEqual("#server-to-user-ID-123", pusher.util.validate_channel("#server-to-user-ID-123"))

valid_server_to_user_channel = "#server-to-user-123"
invalid_server_to_user_channel = "#server-to-useR-123"
valid_server_to_users = "#server-to-users"
valid_server_to_user1234 = "#server-to-user1234"

self.assertEqual(valid_server_to_user_channel, pusher.util.validate_channel(valid_server_to_user_channel))
self.assertEqual(valid_server_to_users, pusher.util.validate_channel(valid_server_to_users))
self.assertEqual(valid_server_to_user1234, pusher.util.validate_channel(valid_server_to_user1234))
with self.assertRaises(ValueError):
pusher.util.validate_channel(invalid_server_to_user_channel)
pusher.util.validate_channel("#server-to-useR-123")
pusher.util.validate_channel("#server-to-user1234")
pusher.util.validate_channel("#server-to-users")


if __name__ == '__main__':
Expand Down

0 comments on commit 1ac47dc

Please sign in to comment.