#NEWLINE# def test_fields( self ) : #NEWLINE# #INDENT# metaxml_section = '\n        <core encoding="utf-8" fieldsTerminatedBy="\t" linesTerminatedBy="\n" fieldsEnclosedBy=""\n        ignoreHeaderLines="0" rowType="http://rs.tdwg.org/dwc/terms/Occurrence">\n            <files>\n                <location>occurrence.txt</location>\n            </files>\n            <id index="0" />\n            <field default="Belgium" term="http://rs.tdwg.org/dwc/terms/country"/>\n            <field index="1" term="http://rs.tdwg.org/dwc/terms/scientificName"/>\n            <field index="2" term="http://rs.tdwg.org/dwc/terms/basisOfRecord"/>\n            <field index="3" term="http://rs.tdwg.org/dwc/terms/family"/>\n            <field index="4" term="http://rs.tdwg.org/dwc/terms/locality"/>\n        </core>\n        ' #NEWLINE# core_descriptor = DataFileDescriptor . make_from_metafile_section ( ET . fromstring ( metaxml_section ) ) #NEWLINE# expected_fields = ( { #NEWLINE# #INDENT# 'term' : 'http://rs.tdwg.org/dwc/terms/country' , #NEWLINE# 'index' : None , #NEWLINE# 'default' : 'Belgium' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'term' : 'http://rs.tdwg.org/dwc/terms/scientificName' , #NEWLINE# 'index' : 1 , #NEWLINE# 'default' : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# for ef in expected_fields : #NEWLINE# #INDENT# self . assertTrue ( ( core_descriptor in core_descriptor . fields ) ) #NEWLINE# #UNINDENT# self . assertEqual ( len ( core_descriptor . fields ) , 5 )