本文整理匯總了Python中musicbrainz2.wsxml.MbXmlParser.getLabel方法的典型用法代碼示例。如果您正苦於以下問題:Python MbXmlParser.getLabel方法的具體用法?Python MbXmlParser.getLabel怎麽用?Python MbXmlParser.getLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類musicbrainz2.wsxml.MbXmlParser
的用法示例。
在下文中一共展示了MbXmlParser.getLabel方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testTags
# 需要導入模塊: from musicbrainz2.wsxml import MbXmlParser [as 別名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getLabel [as 別名]
def testTags(self):
f = os.path.join(VALID_LABEL_DIR, 'Atlantic_Records_3.xml')
md = MbXmlParser().parse(f)
label = md.getLabel()
self.failIf( label is None )
self.assertEquals(label.getTag('american').count, None)
self.assertEquals(label.getTag('jazz').count, None)
self.assertEquals(label.getTag('blues').count, None)
示例2: testIncomplete
# 需要導入模塊: from musicbrainz2.wsxml import MbXmlParser [as 別名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getLabel [as 別名]
def testIncomplete(self):
f = os.path.join(VALID_LABEL_DIR, 'Atlantic_Records_3.xml')
md = MbXmlParser().parse(f)
label = md.getLabel()
self.failIf( label is None )
self.assertEquals(label.id,
makeId('50c384a2-0b44-401b-b893-8181173339c7'))
self.assertEquals(label.code, None)
示例3: testLabelBasic
# 需要導入模塊: from musicbrainz2.wsxml import MbXmlParser [as 別名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getLabel [as 別名]
def testLabelBasic(self):
f = os.path.join(VALID_LABEL_DIR, 'Atlantic_Records_1.xml')
md = MbXmlParser().parse(f)
label = md.getLabel()
self.failIf( label is None )
self.assertEquals(label.id,
makeId('50c384a2-0b44-401b-b893-8181173339c7'))
self.assertEquals(label.type, NS_MMD_1 + 'OriginalProduction')
self.assertEquals(label.name, 'Atlantic Records')
self.assertEquals(label.beginDate, '1947')
self.assertEquals(label.endDate, None)
self.assertEquals(label.country, 'US')
self.assertEquals(label.code, '121')
示例4: testLabelSubElements
# 需要導入模塊: from musicbrainz2.wsxml import MbXmlParser [as 別名]
# 或者: from musicbrainz2.wsxml.MbXmlParser import getLabel [as 別名]
def testLabelSubElements(self):
f = os.path.join(VALID_LABEL_DIR, 'Atlantic_Records_2.xml')
md = MbXmlParser().parse(f)
label = md.getLabel()
self.failIf( label is None )
self.assertEquals(label.type, NS_MMD_1 + 'Distributor')
self.assertEquals(label.name, 'Atlantic Records')
self.assertEquals(label.sortName, 'AR SortName')
self.assertEquals(label.disambiguation, 'fake')
self.assertEquals(label.beginDate, '1947')
self.assertEquals(label.endDate, '2047')
self.assertEquals(label.country, 'US')
self.assertEquals(label.code, '121')
self.assertEquals(len(label.aliases), 1)
alias = label.aliases[0]
self.assertEquals(alias.value, 'Atlantic Rec.')
self.assertEquals(label.getUniqueName(),
'Atlantic Records (fake)')