Add example 2.8

This commit is contained in:
Simeon Warner 2013-06-17 21:51:23 -04:00
parent 2af04a7a3f
commit 646530edab
2 changed files with 24 additions and 0 deletions

View File

@ -18,6 +18,11 @@ Example 2.7
- I am not sure the rel="describedby" within the <url> block for the capability list has the correct meaning. Doesn't it mean in that context that the capability list if descibedby the giev resource? That seems not quite the same as our usual interpretation of top level rel="describedby" which we take to be a description of the set of resources rather than the capability document.
Example 2.8
-----------
- why is part2 before part1? In other documents we write them so that the are read in a forward/chronological direction, this seems backwards.
Section 3
---------

View File

@ -217,6 +217,25 @@ class TestExamplesFromSpec(unittest.TestCase):
ex_xml = self._open_ex('resourcesync_ex_2_7').read()
self._assert_xml_equal( rsd.as_xml(), ex_xml )
def test_build_ex_2_8(self):
""" Simple Resource List Index document
This is not something that would usually be created directly
but instead would be created as part of the process of
writing a large Resource List in multiple files. However,
it is possible to create manually.
"""
rli = ResourceList()
rli.resources = [] # fudge to get order to match spec
rli.sitemapindex=True
rli.md_from = '2013-01-03T09:00:00Z'
rli.resources.append( Resource(uri='http://example.com/resourcelist-part2.xml',
lastmod='2013-01-03T09:00:00Z') )
rli.resources.append( Resource(uri='http://example.com/resourcelist-part1.xml',
lastmod='2013-01-03T09:00:00Z') )
ex_xml = self._open_ex('resourcesync_ex_2_8').read()
self._assert_xml_equal( rli.as_xml(), ex_xml )
def test_build_ex_4_1(self):
rl = ResourceList()
rl.description='http://example.com/dataset1/capabilitylist.xml'