#NEWLINE# def test10_parse( self ) : #NEWLINE# #INDENT# xml = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:rs="http://www.openarchives.org/rs/terms/"><rs:md at="2013-01-01" capability="resourcedump"/><url><loc>http://example.com/a.zip</loc><lastmod>2012-03-14T18:37:36Z</lastmod><rs:md length="12345" /></url><url><loc>http://example.com/b.zip</loc><lastmod>2012-03-14T18:37:36Z</lastmod><rs:md length="56789" /></url></urlset>' #NEWLINE# rd = ResourceDump ( ) #NEWLINE# rd . parse ( fh = io . StringIO ( xml ) ) #NEWLINE# self . assertEqual ( len ( rd . resources ) , 2 , 'got 2 resource dumps' ) #NEWLINE# self . assertEqual ( rd . capability , 'resourcedump' , 'capability set' ) #NEWLINE# self . assertEqual ( rd . md_at , '2013-01-01' ) #NEWLINE# self . assertTrue ( ( 'http://example.com/a.zip' in rd . resources ) ) #NEWLINE# self . assertTrue ( rd . resources [ 'http://example.com/a.zip' ] . length , 12345 ) #NEWLINE# self . assertTrue ( ( 'http://example.com/b.zip' in rd . resources ) ) #NEWLINE# self . assertTrue ( rd . resources [ 'http://example.com/b.zip' ] . length , 56789 )