本文整理汇总了Python中decoder.Decoder.decodeString方法的典型用法代码示例。如果您正苦于以下问题:Python Decoder.decodeString方法的具体用法?Python Decoder.decodeString怎么用?Python Decoder.decodeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类decoder.Decoder
的用法示例。
在下文中一共展示了Decoder.decodeString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_decodeString_shouldReturnDecodedMsg
# 需要导入模块: from decoder import Decoder [as 别名]
# 或者: from decoder.Decoder import decodeString [as 别名]
def test_decodeString_shouldReturnDecodedMsg(self):
decoder = Decoder(cog1=6)
decodedString = decoder.decodeString('ab')
self.assertEqual(decodedString, 'gh')
示例2: test_decodeString_shouldDecodedNLengthMsg
# 需要导入模块: from decoder import Decoder [as 别名]
# 或者: from decoder.Decoder import decodeString [as 别名]
def test_decodeString_shouldDecodedNLengthMsg(self):
decoder = Decoder(cog1=6)
decodedString = decoder.decodeString('1234')
self.assertEqual(decodedString, '789A')
示例3: getResourceFromReferenceUrl
# 需要导入模块: from decoder import Decoder [as 别名]
# 或者: from decoder.Decoder import decodeString [as 别名]
from decoder import Decoder
from questionRetriever import QuestionRetriever
def getResourceFromReferenceUrl(referenceUrl):
lastSlash = referenceUrl.rfind('/')
dothtml = referenceUrl.rfind('.html')
return referenceUrl[lastSlash:dothtml]
questions = QuestionRetriever()
question1 = questions.getFirstQuestion()
decoder = Decoder(cog1=6)
question1Answer = decoder.decodeString(question1['question'])
question2 = questions.getNextQuestion(getResourceFromReferenceUrl(question1['reference-url']), question1Answer)
decoder = Decoder(cog1=9, cog2=3)
question2Answer = decoder.decodeString(question2['question'])
question3 = questions.getNextQuestion(getResourceFromReferenceUrl(question2['reference-url']), question2Answer)