From 646530edabf3cae8cad830d21998e99c2b396e91 Mon Sep 17 00:00:00 2001 From: Simeon Warner Date: Mon, 17 Jun 2013 21:51:23 -0400 Subject: [PATCH] Add example 2.8 --- TODO.md | 5 +++++ resync/test/test_examples_from_spec.py | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/TODO.md b/TODO.md index 2a9ca22..137616c 100644 --- a/TODO.md +++ b/TODO.md @@ -18,6 +18,11 @@ Example 2.7 - I am not sure the rel="describedby" within the 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 --------- diff --git a/resync/test/test_examples_from_spec.py b/resync/test/test_examples_from_spec.py index 934b9c2..04d7d62 100644 --- a/resync/test/test_examples_from_spec.py +++ b/resync/test/test_examples_from_spec.py @@ -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'