def test20_index_as_xml(self):
     # Check XML for empty case
     lb = ListBaseWithIndex()
     self.assertEqual(lb.index_as_xml(
     ), '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:rs="http://www.openarchives.org/rs/terms/"><rs:md capability="unknown" /></sitemapindex>')
     # Add a resource and make sure we find that
     lb.add(Resource(uri='a', lastmod='2001-01-01', length=1234))
     xml = lb.index_as_xml()
     self.assertTrue(
         re.search(r'<loc>a</loc><lastmod>2001-01-01T00:00:00Z</lastmod>', xml))
Example #2
0
 def test20_index_as_xml(self):
     # Check XML for empty case
     lb = ListBaseWithIndex()
     self.assertEqual(
         lb.index_as_xml(),
         '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:rs="http://www.openarchives.org/rs/terms/"><rs:md capability="unknown" /></sitemapindex>'
     )
     # Add a resource and make sure we find that
     lb.add(Resource(uri='a', lastmod='2001-01-01', length=1234))
     xml = lb.index_as_xml()
     self.assertTrue(
         re.search(r'<loc>a</loc><lastmod>2001-01-01T00:00:00Z</lastmod>',
                   xml))