本文整理汇总了Python中pubnub.pubnub_asyncio.PubNubAsyncio.remove_channel_group方法的典型用法代码示例。如果您正苦于以下问题:Python PubNubAsyncio.remove_channel_group方法的具体用法?Python PubNubAsyncio.remove_channel_group怎么用?Python PubNubAsyncio.remove_channel_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pubnub.pubnub_asyncio.PubNubAsyncio
的用法示例。
在下文中一共展示了PubNubAsyncio.remove_channel_group方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_super_call
# 需要导入模块: from pubnub.pubnub_asyncio import PubNubAsyncio [as 别名]
# 或者: from pubnub.pubnub_asyncio.PubNubAsyncio import remove_channel_group [as 别名]
def test_super_call(event_loop):
pubnub = PubNubAsyncio(pnconf_pam_copy(), custom_event_loop=event_loop)
ch = "channel-groups-torna|do-ch"
gr = "channel-groups-torna|do-cg"
pubnub.config.auth = "h.e|l%l,0"
# add
env = yield from pubnub.add_channel_to_channel_group() \
.channels(ch).channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsAddChannelResult)
# list
env = yield from pubnub.list_channels_in_channel_group().channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsListResult)
# remove channel
env = yield from pubnub.remove_channel_from_channel_group().channel_group(gr).channels(ch).future()
assert isinstance(env.result, PNChannelGroupsRemoveChannelResult)
# remove group
env = yield from pubnub.remove_channel_group().channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsRemoveGroupResult)
# list
env = yield from pubnub.list_channels_in_channel_group().channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsListResult)
pubnub.stop()
示例2: test_add_channel_remove_group
# 需要导入模块: from pubnub.pubnub_asyncio import PubNubAsyncio [as 别名]
# 或者: from pubnub.pubnub_asyncio.PubNubAsyncio import remove_channel_group [as 别名]
def test_add_channel_remove_group(event_loop, sleeper=asyncio.sleep):
pubnub = PubNubAsyncio(pnconf, custom_event_loop=event_loop)
ch = "channel-groups-tornado-ch"
gr = "channel-groups-tornado-cg"
# add
env = yield from pubnub.add_channel_to_channel_group() \
.channels(ch).channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsAddChannelResult)
yield from sleeper(1)
# list
env = yield from pubnub.list_channels_in_channel_group().channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsListResult)
assert len(env.result.channels) == 1
assert env.result.channels[0] == ch
# remove group
env = yield from pubnub.remove_channel_group().channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsRemoveGroupResult)
yield from sleeper(1)
# list
env = yield from pubnub.list_channels_in_channel_group().channel_group(gr).future()
assert isinstance(env.result, PNChannelGroupsListResult)
assert len(env.result.channels) == 0
pubnub.stop()