本文整理汇总了Python中mpx.service.subscription_manager.SUBSCRIPTION_MANAGER.diag_get_mnbs方法的典型用法代码示例。如果您正苦于以下问题:Python SUBSCRIPTION_MANAGER.diag_get_mnbs方法的具体用法?Python SUBSCRIPTION_MANAGER.diag_get_mnbs怎么用?Python SUBSCRIPTION_MANAGER.diag_get_mnbs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpx.service.subscription_manager.SUBSCRIPTION_MANAGER
的用法示例。
在下文中一共展示了SUBSCRIPTION_MANAGER.diag_get_mnbs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _print_mnbs
# 需要导入模块: from mpx.service.subscription_manager import SUBSCRIPTION_MANAGER [as 别名]
# 或者: from mpx.service.subscription_manager.SUBSCRIPTION_MANAGER import diag_get_mnbs [as 别名]
def _print_mnbs(self):
print ""
print "*"*60
for s in SUBSCRIPTION_MANAGER.diag_get_mnbs():
print s
print "*"*60
return
示例2: test_destroy_batch
# 需要导入模块: from mpx.service.subscription_manager import SUBSCRIPTION_MANAGER [as 别名]
# 或者: from mpx.service.subscription_manager.SUBSCRIPTION_MANAGER import diag_get_mnbs [as 别名]
def test_destroy_batch(self):
sids = []
for i in range(2):
# BatchNodes change "really fast."
sid = SUBSCRIPTION_MANAGER.create_polled(self.nrtB10)
# Make sure it comes up.
t1 = time.time()
self.__values_changing(sid)
sids.append(sid)
# Double check the values are changing.
for sid in sids:
self.__values_changing(sid)
# Now nuke one of the suscriptions and see that the other stays valid.
sid = sids.pop(0)
SUBSCRIPTION_MANAGER.destroy(sid)
try:
SUBSCRIPTION_MANAGER.destroy(sid)
except ENoSuchSubscription:
pass
else:
raise "No such subscription not detected."
# Make sure that the other subscription is valid.
sid = sids.pop(0)
self.__values_changing(sid)
if len(SUBSCRIPTION_MANAGER.diag_get_mnrs()) != 10:
raise (
"Bogus test, there should be 10 mnr at this point, not %r." %
len(SUBSCRIPTION_MANAGER.diag_get_mnrs()))
if len(SUBSCRIPTION_MANAGER.diag_get_mnbs()) != 1:
raise (
"Bogus test, there should be 1 mnb at this point, not %r." %
len(SUBSCRIPTION_MANAGER.diag_get_mnbs()))
SUBSCRIPTION_MANAGER.destroy(sid)
# Make sure that the mnr is removed when the last snr is deleted.
if len(SUBSCRIPTION_MANAGER.diag_get_mnrs()) != 0:
raise (
"There should not be any mnrs at this point,"
" but there are %r." %
len(SUBSCRIPTION_MANAGER.diag_get_mnrs()))
# Finally, make sure that the mnb is removed when the last mnr is
# deleted.
if len(SUBSCRIPTION_MANAGER.diag_get_mnbs()) != 0:
raise (
"There should not be any mnbs at this point,"
" but there are %r." %
len(SUBSCRIPTION_MANAGER.diag_get_mnbs()))
return