本文整理匯總了Python中musicbrainz2.wsxml.MbXmlParser.getReleaseGroupResults方法的典型用法代碼示例。如果您正苦於以下問題:Python MbXmlParser.getReleaseGroupResults方法的具體用法?Python MbXmlParser.getReleaseGroupResults怎麽用?Python MbXmlParser.getReleaseGroupResults使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類musicbrainz2.wsxml.MbXmlParser
的用法示例。
在下文中一共展示了MbXmlParser.getReleaseGroupResults方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testSearchResults
# 需要導入模塊: from musicbrainz2.wsxml import MbXmlParser [as 別名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getReleaseGroupResults [as 別名]
def testSearchResults(self):
f = os.path.join(RELEASEGROUP_DIR, 'search_result_1.xml')
md = MbXmlParser().parse(f)
releaseGroups = md.getReleaseGroupResults()
self.failIf(releaseGroups is None)
self.assertEquals(md.getReleaseGroupResultsOffset(), 0)
self.assertEquals(md.getReleaseGroupResultsCount(), 3)
expectedEntries = {
'963eac15-e3da-3a92-aa5c-2ec23bfb6ec2': ['Signal Morning', 100],
'0bd324a3-1c90-3bdb-8ca4-4101a580c62c': ['Circulatory System', 98],
'ea7d8352-7751-30be-8490-bb6df737f47c': ['Inside Views', 90]}
for result in releaseGroups:
releaseGroup = result.releaseGroup
self.failIf(releaseGroup is None)
releaseGroupId = releaseGroup.id[-36:]
self.assert_(releaseGroupId in expectedEntries)
expectedTitle, expectedScore = expectedEntries[releaseGroupId]
self.assertEquals(releaseGroup.title, expectedTitle)
self.assertEquals(result.score, expectedScore)
del expectedEntries[releaseGroupId]