#NEWLINE# def test_19_parse_with_bad_rs_ln( self ) : #NEWLINE# #INDENT# xmlstart = '<?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>' #NEWLINE# xmlend = '</url></urlset>' #NEWLINE# s = Sitemap ( ) #NEWLINE# xml = ( ( xmlstart + '<rs:ln rel="duplicate"/>' ) + xmlend ) #NEWLINE# self . assertRaises ( SitemapParseError , s . parse_xml , fh = io . StringIO ( xml ) ) #NEWLINE# xml = ( ( xmlstart + '<rs:ln href="http://example.com/"/>' ) + xmlend ) #NEWLINE# self . assertRaises ( SitemapParseError , s . parse_xml , fh = io . StringIO ( xml ) ) #NEWLINE# xml = ( ( xmlstart + '<rs:ln rel="duplicate" href="http://example.com/" length="a"/>' ) + xmlend ) #NEWLINE# self . assertRaises ( SitemapParseError , s . parse_xml , fh = io . StringIO ( xml ) ) #NEWLINE# xml = ( ( xml + '<rs:ln rel="duplicate" href="http://example.com/" pri="fff"/>' ) + xmlend ) #NEWLINE# self . assertRaises ( SitemapParseError , s . parse_xml , fh = io . StringIO ( xml ) ) #NEWLINE# xml = ( ( xmlstart + '<rs:ln rel="duplicate" href="http://example.com/" pri="0"/>' ) + xmlend ) #NEWLINE# self . assertRaises ( SitemapParseError , s . parse_xml , fh = io . StringIO ( xml ) ) #NEWLINE# xml = ( ( xmlstart + '<rs:ln rel="duplicate" href="http://example.com/" pri="1000000"/>' ) + xmlend ) #NEWLINE# self . assertRaises ( SitemapParseError , s . parse_xml , fh = io . StringIO ( xml ) ) #NEWLINE# xml = ( ( xmlstart + '<rs:ln rel="duplicate" href="http://example.com/" length="12345" pri="1" other="whatever"/>' ) + xmlend ) #NEWLINE# rc = s . parse_xml ( fh = io . StringIO ( xml ) ) #NEWLINE# self . assertEqual ( len ( rc . resources ) , 1 , 'good at last, extra attribute ignored' )