def test_build_ex_21(self):
     """Change List which points back to index"""
     cl = ChangeList()
     cl.up = 'http://example.com/dataset1/capabilitylist.xml'
     cl.index = 'http://example.com/dataset1/changelist.xml'
     cl.md_from = "2013-01-02T00:00:00Z"
     cl.md_until = "2013-01-03T00:00:00Z"
     cl.add(
         Resource(uri='http://example.com/res7.html',
                  lastmod='2013-01-02T12:00:00Z',
                  change='created'))
     cl.add(
         Resource(uri='http://example.com/res9.pdf',
                  lastmod='2013-01-02T13:00:00Z',
                  change='updated'))
     cl.add(
         Resource(uri='http://example.com/res5.tiff',
                  lastmod='2013-01-02T19:00:00Z',
                  change='deleted'))
     cl.add(
         Resource(uri='http://example.com/res7.html',
                  lastmod='2013-01-02T20:00:00Z',
                  change='updated'))
     ex_xml = self._open_ex('resourcesync_ex_21').read()
     self._assert_xml_equal(cl.as_xml(), ex_xml)
Esempio n. 2
0
 def test_build_ex_03(self):
     """Simple Change List document """
     cl = ChangeList()
     cl.md_from = '2013-01-02T00:00:00Z'
     cl.md_until= '2013-01-03T00:00:00Z'
     cl.add( Resource(uri='http://example.com/res2.pdf',
                      lastmod='2013-01-02T13:00:00Z',
                      change="updated") )
     cl.add( Resource(uri='http://example.com/res3.tiff',
                      lastmod='2013-01-02T18:00:00Z',
                      change='deleted') )
     ex_xml = self._open_ex('resourcesync_ex_3').read()
     self._assert_xml_equal( cl.as_xml(), ex_xml )
Esempio n. 3
0
 def test_build_ex_21(self):
     """Change List which points back to index"""
     cl = ChangeList()
     cl.up = 'http://example.com/dataset1/capabilitylist.xml'
     cl.index = 'http://example.com/dataset1/changelist.xml'
     cl.md_from="2013-01-02T00:00:00Z"
     cl.md_until="2013-01-03T00:00:00Z"
     cl.add( Resource( uri='http://example.com/res7.html',
                       lastmod='2013-01-02T12:00:00Z',
                       change='created' ) )
     cl.add( Resource( uri='http://example.com/res9.pdf',
                       lastmod='2013-01-02T13:00:00Z',
                       change='updated' ) )
     cl.add( Resource( uri='http://example.com/res5.tiff',
                       lastmod='2013-01-02T19:00:00Z',
                       change='deleted' ) )
     cl.add( Resource( uri='http://example.com/res7.html',
                       lastmod='2013-01-02T20:00:00Z',
                       change='updated' ) )
     ex_xml = self._open_ex('resourcesync_ex_21').read()
     self._assert_xml_equal( cl.as_xml(), ex_xml )