本文整理汇总了Python中Message.Message.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Python Message.getParameter方法的具体用法?Python Message.getParameter怎么用?Python Message.getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message.Message
的用法示例。
在下文中一共展示了Message.getParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verifyPurchaseMessage
# 需要导入模块: from Message import Message [as 别名]
# 或者: from Message.Message import getParameter [as 别名]
def verifyPurchaseMessage(sock2, qty):
received = sock2.recv(16800)
messagePurchase= Message(received)
print messagePurchase.__str__()
if (not messagePurchase.isMessageStatusOk()):
raise FoundationException("error in creating purchase")
else:
# verify that the quantity purchased.
qtyPurchasedStr = messagePurchase.getParameter('Quantity_Purchased')
qtyPurchased = float(qtyPurchasedStr)
if (qtyPurchased <> qty):
print "error in creating purchase - Qty purchased" + str(qtyPurchased)+ " not equal to " + str(qty)
示例2: verifyAvailabilityMessage
# 需要导入模块: from Message import Message [as 别名]
# 或者: from Message.Message import getParameter [as 别名]
def verifyAvailabilityMessage(sock2, qty):
received = sock2.recv(16800)
messageAvail= Message(received)
print messageAvail.__str__()
if (not messageAvail.isMessageStatusOk()):
raise FoundationException("error in the availability message")
else:
# verify that the quantity purchased.
qtyStr = messageAvail.getParameter('Quantity')
qtyAvail = float(qtyStr)
qtyAvail = round(qtyAvail,2)
if (qtyAvail <> qty):
print "error in the quantity available" + str(qtyAvail)+ "- Qty not equal to " + str(qty)