当前位置: 首页>>代码示例>>Python>>正文


Python PubNubAsyncio.remove_channel_group方法代码示例

本文整理汇总了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()
开发者ID:pubnub,项目名称:python,代码行数:32,代码来源:test_channel_groups.py

示例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()
开发者ID:pubnub,项目名称:python,代码行数:35,代码来源:test_channel_groups.py


注:本文中的pubnub.pubnub_asyncio.PubNubAsyncio.remove_channel_group方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。