Exemplo n.º 1
0
 def test_build_archives_ex_5_1(self):
     """Change List Archive listing 3 Change Lists"""
     cla = ChangeListArchive()
     cla.up = 'http://example.com/dataset1/capabilitylist.xml'
     cla.add( Resource( uri='http://example.com/changelist1.xml',
                        md_from='2013-01-01T09:00:00Z',
                        md_until='2013-01-02T09:00:00Z') )
     cla.add( Resource( uri='http://example.com/changelist2.xml',
                        md_from='2013-01-02T09:00:00Z',
                        md_until='2013-01-03T09:00:00Z') )
     cla.add( Resource( uri='http://example.com/changelist3.xml',
                        md_from='2013-01-03T09:00:00Z',
                        md_until='2013-01-04T09:00:00Z') )
     ex_xml = self._open_ex('archives_ex_5_1').read()
     self._assert_xml_equal( cla.as_xml(), ex_xml )
Exemplo n.º 2
0
 def test_build_ex_20(self):
     """Change List Index listing 3 Change Lists, the last one 'open'"""
     cl = ChangeListArchive(resources_class=ResourceListOrdered) #order in example is non-canonical   
     cl.sitemapindex=True
     cl.capability_name='changelist'
     cl.up = 'http://example.com/dataset1/capabilitylist.xml'
     cl.md_from="2013-01-01T00:00:00Z"
     cl.add( Resource( uri='http://example.com/20130101-changelist.xml',
                       md_from='2013-01-01T00:00:00Z',
                       md_until='2013-01-02T00:00:00Z') )
     cl.add( Resource( uri='http://example.com/20130102-changelist.xml',
                       md_from='2013-01-02T00:00:00Z',
                       md_until='2013-01-03T00:00:00Z') )
     cl.add( Resource( uri='http://example.com/20130103-changelist.xml',
                       md_from='2013-01-03T00:00:00Z') )
     ex_xml = self._open_ex('resourcesync_ex_20').read()
     self._assert_xml_equal( cl.as_xml(), ex_xml )