Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
96 lines (75 loc) · 3.51 KB

File metadata and controls

executable file
·
96 lines (75 loc) · 3.51 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from pubnub import Pubnub
import random
pubnub = Pubnub("demo", "demo")
pubnub.set_u(True)
def rand_str(s):
return str(s) + '-' + str(random.randint(1, 100000000000))
def test_1():
channel = rand_str('channel')
channel2 = rand_str('channel')
channel_group = rand_str('group')
channel_group2 = rand_str('group')
namespace = rand_str('ns')
resp = pubnub.channel_group_add_channel(channel_group=namespace + ':' + channel_group, channel=channel)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_add_channel(channel_group=namespace + ':' + channel_group, channel=channel2)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_add_channel(channel_group=namespace + ':' + channel_group2, channel=channel)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_add_channel(channel_group=namespace + ':' + channel_group2, channel=channel2)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_list_channels(channel_group=namespace + ':' + channel_group)
assert channel in resp['payload']['channels']
assert channel2 in resp['payload']['channels']
assert len(resp['payload']['channels']) == 2
resp = pubnub.channel_group_remove_channel(channel_group=namespace + ':' + channel_group, channel=channel2)
print(resp)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_list_channels(channel_group=namespace + ':' + channel_group)
print(resp)
assert channel in resp['payload']['channels']
assert len(resp['payload']['channels']) == 1
resp = pubnub.channel_group_list_channels(channel_group=namespace + ':' + channel_group2)
assert channel in resp['payload']['channels']
assert channel2 in resp['payload']['channels']
assert len(resp['payload']['channels']) == 2
resp = pubnub.channel_group_remove_channel(channel_group=namespace + ':' + channel_group2, channel=channel2)
print(resp)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_list_channels(channel_group=namespace + ':' + channel_group2)
print(resp)
assert channel in resp['payload']['channels']
assert len(resp['payload']['channels']) == 1
resp = pubnub.channel_group_list_groups(namespace=namespace)
assert channel_group in resp['payload']['groups']
assert channel_group2 in resp['payload']['groups']
assert len(resp['payload']['groups']) == 2
resp = pubnub.channel_group_remove_group(channel_group=namespace + ':' + channel_group2)
print(resp)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_list_groups(namespace=namespace)
assert channel_group in resp['payload']['groups']
assert len(resp['payload']['groups']) == 1
resp = pubnub.channel_group_list_namespaces()
assert namespace in resp['payload']['namespaces']
resp = pubnub.channel_group_remove_namespace(namespace=namespace)
print(resp)
assert resp['status'] == 200
assert resp['message'] == 'OK'
assert resp['error'] == False
resp = pubnub.channel_group_list_namespaces()
assert namespace not in resp['payload']['namespaces']
Morty Proxy This is a proxified and sanitized view of the page, visit original site.