#NEWLINE# def test_18_parse_with_rs_ln_on_resource( 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 capability="resourcelist"/><url>  <loc>http://example.com/file_a</loc><lastmod>2012-03-14T18:37:36Z</lastmod>  <rs:md hash="md5:r2d2" length="12345" />  <rs:ln rel="duplicate" href="http://mirror1.example.com/res1" modified="2013-01-02" pri="1" />  <rs:ln rel="num2" href="http://m2.example.com/res1"/>  <rs:ln rel="num3" href="http://m3.example.com/res1"/></url><url>  <loc>http://example.com/file_b</loc><lastmod>2012-03-14T18:37:36Z</lastmod>  <rs:md length="32" /></url></urlset>' #NEWLINE# s = Sitemap ( ) #NEWLINE# rc = s . parse_xml ( fh = io . StringIO ( xml ) ) #NEWLINE# self . assertFalse ( s . parsed_index , 'was a sitemap' ) #NEWLINE# self . assertEqual ( s . resources_created , 2 , 'got 2 resources' ) #NEWLINE# i = iter ( rc ) #NEWLINE# r1 = next ( i ) #NEWLINE# r2 = next ( i ) #NEWLINE# self . assertEqual ( r1 . uri , 'http://example.com/file_a' ) #NEWLINE# self . assertEqual ( r1 . ln [ 0 ] [ 'rel' ] , 'duplicate' ) #NEWLINE# self . assertEqual ( r1 . ln [ 0 ] [ 'href' ] , 'http://mirror1.example.com/res1' ) #NEWLINE# self . assertEqual ( r1 . ln [ 0 ] [ 'modified' ] , '2013-01-02' ) #NEWLINE# self . assertEqual ( r1 . ln [ 0 ] [ 'pri' ] , 1 ) #NEWLINE# self . assertEqual ( r2 . uri , 'http://example.com/file_b' )