本文整理汇总了Python中autopush.db.Message.all_channels方法的典型用法代码示例。如果您正苦于以下问题:Python Message.all_channels方法的具体用法?Python Message.all_channels怎么用?Python Message.all_channels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autopush.db.Message
的用法示例。
在下文中一共展示了Message.all_channels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_channels
# 需要导入模块: from autopush.db import Message [as 别名]
# 或者: from autopush.db.Message import all_channels [as 别名]
def test_save_channels(self):
chid = str(uuid.uuid4())
chid2 = str(uuid.uuid4())
m = get_rotating_message_table()
message = Message(m, SinkMetrics())
message.register_channel(self.uaid, chid)
message.register_channel(self.uaid, chid2)
exists, chans = message.all_channels(self.uaid)
new_uaid = uuid.uuid4().hex
message.save_channels(new_uaid, chans)
_, new_chans = message.all_channels(new_uaid)
eq_(chans, new_chans)
示例2: test_all_channels
# 需要导入模块: from autopush.db import Message [as 别名]
# 或者: from autopush.db.Message import all_channels [as 别名]
def test_all_channels(self):
chid = str(uuid.uuid4())
chid2 = str(uuid.uuid4())
m = get_rotating_message_table()
message = Message(m, SinkMetrics())
message.register_channel(self.uaid, chid)
message.register_channel(self.uaid, chid2)
_, chans = message.all_channels(self.uaid)
assert chid in chans
assert chid2 in chans
message.unregister_channel(self.uaid, chid2)
_, chans = message.all_channels(self.uaid)
assert chid2 not in chans
assert chid in chans
示例3: test_all_channels_no_uaid
# 需要导入模块: from autopush.db import Message [as 别名]
# 或者: from autopush.db.Message import all_channels [as 别名]
def test_all_channels_no_uaid(self):
m = get_rotating_message_table()
message = Message(m, SinkMetrics())
exists, chans = message.all_channels("asdf")
assert chans == set([])
示例4: test_all_channels_no_uaid
# 需要导入模块: from autopush.db import Message [as 别名]
# 或者: from autopush.db.Message import all_channels [as 别名]
def test_all_channels_no_uaid(self):
m = get_message_table()
message = Message(m, SinkMetrics())
assert(message.all_channels("asdf") == set([]))