Skip to content

Commit 1ac47dc

Browse files
Update pusher_tests/test_util.py
Co-authored-by: Evgenii Breikin <[email protected]>
1 parent eb5ba53 commit 1ac47dc

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

pusher_tests/test_util.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@ def test_validate_channel(self):
2828
pusher.util.validate_channel(invalid_channel)
2929

3030
def test_validate_server_to_user_channel(self):
31+
self.assertEqual("#server-to-user-123", pusher.util.validate_channel("#server-to-user-123"))
32+
self.assertEqual("#server-to-user-user123", pusher.util.validate_channel("#server-to-user-user123"))
33+
self.assertEqual("#server-to-user-ID-123", pusher.util.validate_channel("#server-to-user-ID-123"))
3134

32-
valid_server_to_user_channel = "#server-to-user-123"
33-
invalid_server_to_user_channel = "#server-to-useR-123"
34-
valid_server_to_users = "#server-to-users"
35-
valid_server_to_user1234 = "#server-to-user1234"
36-
37-
self.assertEqual(valid_server_to_user_channel, pusher.util.validate_channel(valid_server_to_user_channel))
38-
self.assertEqual(valid_server_to_users, pusher.util.validate_channel(valid_server_to_users))
39-
self.assertEqual(valid_server_to_user1234, pusher.util.validate_channel(valid_server_to_user1234))
4035
with self.assertRaises(ValueError):
41-
pusher.util.validate_channel(invalid_server_to_user_channel)
36+
pusher.util.validate_channel("#server-to-useR-123")
37+
pusher.util.validate_channel("#server-to-user1234")
38+
pusher.util.validate_channel("#server-to-users")
4239

4340

4441
if __name__ == '__main__':

0 commit comments

Comments
 (0)