From cb2d6d26cdbb66c716e351fe94731083538909f0 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Fri, 25 Aug 2006 09:42:51 -0400 Subject: [PATCH] recapture; verify content and xml:lang --- tests/capture.py | 3 +++ tests/data/apply/feed.xml | 2 +- tests/data/config/opml.xml | 3 ++- tests/data/spider/testfeed2.atom | 8 ++++---- tests/data/splice/cache/example.com,3 | 2 +- tests/data/splice/cache/example.com,4 | 2 +- .../planet.intertwingly.net,2006,testfeed1,1 | 2 +- .../planet.intertwingly.net,2006,testfeed1,2 | 2 +- .../planet.intertwingly.net,2006,testfeed1,3 | 2 +- .../planet.intertwingly.net,2006,testfeed1,4 | 2 +- .../planet.intertwingly.net,2006,testfeed2,1 | 2 +- .../planet.intertwingly.net,2006,testfeed2,2 | 2 +- .../planet.intertwingly.net,2006,testfeed2,3 | 2 +- .../planet.intertwingly.net,2006,testfeed2,4 | 2 +- .../planet.intertwingly.net,2006,testfeed3,1 | 2 +- .../planet.intertwingly.net,2006,testfeed3,2 | 2 +- .../sources/tests,data,spider,testfeed0.atom | 2 ++ .../sources/tests,data,spider,testfeed1b.atom | 2 +- .../sources/tests,data,spider,testfeed2.atom | 2 +- .../cache/sources/tests,data,spider,testfeed3.rss | 2 +- tests/test_apply.py | 15 +++++++++++++++ tests/test_rlists.py | 8 ++++---- tests/test_splice.py | 4 ++-- 23 files changed, 48 insertions(+), 27 deletions(-) create mode 100644 tests/data/splice/cache/sources/tests,data,spider,testfeed0.atom diff --git a/tests/capture.py b/tests/capture.py index f95c86e..09f4558 100755 --- a/tests/capture.py +++ b/tests/capture.py @@ -16,7 +16,10 @@ sys.path.insert(0, os.path.split(sys.path[0])[0]) os.chdir(sys.path[0]) # copy spider output to splice input +import planet from planet import spider, config +planet.getLogger('CRITICAL') + spider.spiderPlanet('tests/data/spider/config.ini') if os.path.exists('tests/data/splice/cache'): shutil.rmtree('tests/data/splice/cache') diff --git a/tests/data/apply/feed.xml b/tests/data/apply/feed.xml index b4003d5..2ffbfa1 100644 --- a/tests/data/apply/feed.xml +++ b/tests/data/apply/feed.xml @@ -1,2 +1,2 @@ -test planet2006-08-21T21:40:56ZVenusAnonymous Cowardtag:planet.intertwingly.net,2006:testfeed3/2Venusthe Morning Star2006-08-21T21:40:56ZIt’s just dataSam Rubythreehttp://example.com/4Marsthe Red Planet2006-08-21T21:40:56ZIt’s just dataSam Rubythreetag:planet.intertwingly.net,2006:testfeed1/2Venusthe Jewel of the Sky2006-02-02T00:00:00Z2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zonetag:planet.intertwingly.net,2006:testfeed2/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwotag:planet.intertwingly.net,2006:testfeed1/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zonetag:planet.intertwingly.net,2006:testfeed2/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwotag:planet.intertwingly.net,2006:testfeed1/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zonehttp://example.com/3Earththe Blue Planet2006-01-03T00:00:00ZIt’s just dataSam Rubythreetag:planet.intertwingly.net,2006:testfeed2/2Venusthe Morning Star2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwotag:planet.intertwingly.net,2006:testfeed3/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00ZIt’s just dataSam Rubythreetag:planet.intertwingly.net,2006:testfeed2/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwotag:planet.intertwingly.net,2006:testfeed1/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zonetag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18ZtwoIt’s just dataSam Rubythreetag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone \ No newline at end of file +test planet2006-08-25T13:41:22ZVenusAnonymous Cowardtag:planet.intertwingly.net,2006:testfeed3/2Venusthe Morning Star2006-08-25T13:41:22ZIt’s just dataSam Rubythree200http://example.com/4Marsthe Red Planet2006-08-25T13:41:22ZIt’s just dataSam Rubythree200tag:planet.intertwingly.net,2006:testfeed1/2Venusthe Jewel of the Sky2006-02-02T00:00:00Z2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200tag:planet.intertwingly.net,2006:testfeed2/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200tag:planet.intertwingly.net,2006:testfeed1/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200tag:planet.intertwingly.net,2006:testfeed2/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200tag:planet.intertwingly.net,2006:testfeed1/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200http://example.com/3Earththe Blue Planet2006-01-03T00:00:00ZIt’s just dataSam Rubythree200tag:planet.intertwingly.net,2006:testfeed2/2Venusthe Morning Star2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200tag:planet.intertwingly.net,2006:testfeed3/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00ZIt’s just dataSam Rubythree200tag:planet.intertwingly.net,2006:testfeed2/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200tag:planet.intertwingly.net,2006:testfeed1/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200500not foundtag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200It’s just dataSam Rubythree200tag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200 \ No newline at end of file diff --git a/tests/data/config/opml.xml b/tests/data/config/opml.xml index dbfd562..165e160 100644 --- a/tests/data/config/opml.xml +++ b/tests/data/config/opml.xml @@ -2,11 +2,12 @@ test planet - August 21, 2006 09:40 PM + August 25, 2006 01:41 PM Anonymous Coward + diff --git a/tests/data/spider/testfeed2.atom b/tests/data/spider/testfeed2.atom index 3fac57a..11e4875 100644 --- a/tests/data/spider/testfeed2.atom +++ b/tests/data/spider/testfeed2.atom @@ -13,7 +13,7 @@ 2006-06-16T20:15:18-04:00 - + tag:planet.intertwingly.net,2006:testfeed2/1 Mercury @@ -21,11 +21,11 @@ 2006-01-01T00:00:00Z - + tag:planet.intertwingly.net,2006:testfeed2/2 Venus - the Morning Star + the Morning Star 2006-01-02T00:00:00Z @@ -33,7 +33,7 @@ tag:planet.intertwingly.net,2006:testfeed2/3 Earth - the Blue Planet + the Blue Planet 2006-01-03T00:00:00Z diff --git a/tests/data/splice/cache/example.com,3 b/tests/data/splice/cache/example.com,3 index 1297a57..fce77be 100644 --- a/tests/data/splice/cache/example.com,3 +++ b/tests/data/splice/cache/example.com,3 @@ -1,2 +1,2 @@ -http://example.com/3Earththe Blue Planet2006-01-03T00:00:00ZIt’s just dataSam Rubythree \ No newline at end of file +http://example.com/3Earththe Blue Planet2006-01-03T00:00:00ZIt’s just dataSam Rubythree200 \ No newline at end of file diff --git a/tests/data/splice/cache/example.com,4 b/tests/data/splice/cache/example.com,4 index 2f6db02..2124793 100644 --- a/tests/data/splice/cache/example.com,4 +++ b/tests/data/splice/cache/example.com,4 @@ -1,2 +1,2 @@ -http://example.com/4Marsthe Red Planet2006-08-21T21:40:56ZIt’s just dataSam Rubythree \ No newline at end of file +http://example.com/4Marsthe Red Planet2006-08-25T13:41:22ZIt’s just dataSam Rubythree200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,1 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,1 index 197047c..f66cb50 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,1 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,1 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed1/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed1/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,2 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,2 index ea032ab..5495580 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,2 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,2 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed1/2Venusthe Jewel of the Sky2006-02-02T00:00:00Z2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed1/2Venusthe Jewel of the Sky2006-02-02T00:00:00Z2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,3 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,3 index 502e776..ab02a18 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,3 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,3 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed1/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed1/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,4 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,4 index 484695c..2df1c64 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,4 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed1,4 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed1/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed1/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,1 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,1 index 38e1d75..91ece2e 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,1 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,1 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed2/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed2/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,2 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,2 index 5be1d17..775e0c1 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,2 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,2 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed2/2Venusthe Morning Star2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed2/2Venusthe Morning Star2006-01-02T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,3 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,3 index 8fe829c..2280686 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,3 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,3 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed2/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed2/3Earththe Blue Planet2006-01-03T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,4 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,4 index fa2f2ba..296b19c 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,4 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed2,4 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed2/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed2/4Marsthe Red Planet2006-01-04T00:00:00Ztag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,1 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,1 index 2517250..945f7a3 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,1 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,1 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed3/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00ZIt’s just dataSam Rubythree \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed3/1MercuryMessenger of the Roman Gods2006-01-01T00:00:00ZIt’s just dataSam Rubythree200 \ No newline at end of file diff --git a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,2 b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,2 index 80f70fd..040da55 100644 --- a/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,2 +++ b/tests/data/splice/cache/planet.intertwingly.net,2006,testfeed3,2 @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed3/2Venusthe Morning Star2006-08-21T21:40:56ZIt’s just dataSam Rubythree \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed3/2Venusthe Morning Star2006-08-25T13:41:22ZIt’s just dataSam Rubythree200 \ No newline at end of file diff --git a/tests/data/splice/cache/sources/tests,data,spider,testfeed0.atom b/tests/data/splice/cache/sources/tests,data,spider,testfeed0.atom new file mode 100644 index 0000000..1894ca0 --- /dev/null +++ b/tests/data/splice/cache/sources/tests,data,spider,testfeed0.atom @@ -0,0 +1,2 @@ + +not found500 \ No newline at end of file diff --git a/tests/data/splice/cache/sources/tests,data,spider,testfeed1b.atom b/tests/data/splice/cache/sources/tests,data,spider,testfeed1b.atom index 86c5070..4cb2399 100644 --- a/tests/data/splice/cache/sources/tests,data,spider,testfeed1b.atom +++ b/tests/data/splice/cache/sources/tests,data,spider,testfeed1b.atom @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed1Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Zone200 \ No newline at end of file diff --git a/tests/data/splice/cache/sources/tests,data,spider,testfeed2.atom b/tests/data/splice/cache/sources/tests,data,spider,testfeed2.atom index 1eb834f..fa8f900 100644 --- a/tests/data/splice/cache/sources/tests,data,spider,testfeed2.atom +++ b/tests/data/splice/cache/sources/tests,data,spider,testfeed2.atom @@ -1,2 +1,2 @@ -tag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo \ No newline at end of file +tag:planet.intertwingly.net,2006:testfeed2Sam Rubyrubys@intertwingly.nethttp://www.intertwingly.net/blog/It’s just dataSam Ruby2006-06-17T00:15:18Ztwo200 \ No newline at end of file diff --git a/tests/data/splice/cache/sources/tests,data,spider,testfeed3.rss b/tests/data/splice/cache/sources/tests,data,spider,testfeed3.rss index 2bd9696..01432d4 100644 --- a/tests/data/splice/cache/sources/tests,data,spider,testfeed3.rss +++ b/tests/data/splice/cache/sources/tests,data,spider,testfeed3.rss @@ -1,2 +1,2 @@ -It’s just dataSam Rubythree \ No newline at end of file +It’s just dataSam Rubythree200 \ No newline at end of file diff --git a/tests/test_apply.py b/tests/test_apply.py index bdd0468..c785287 100644 --- a/tests/test_apply.py +++ b/tests/test_apply.py @@ -2,6 +2,7 @@ import unittest, os, shutil from planet import config, splice +from xml.dom import minidom workdir = 'tests/work/apply' configfile = 'tests/data/apply/config.ini' @@ -27,7 +28,21 @@ class ApplyTest(unittest.TestCase): config.load(configfile) splice.apply(feeddata) + # verify that selected files are there for file in ['index.html', 'default.css', 'images/foaf.png']: path = os.path.join(workdir, file) self.assertTrue(os.path.exists(path)) self.assertTrue(os.stat(path).st_size > 0) + + # verify that index.html is well formed, has content, and xml:lang + html = open(os.path.join(workdir, 'index.html')) + doc = minidom.parse(html) + list = [] + content = lang = 0 + for div in doc.getElementsByTagName('div'): + if div.getAttribute('class') != 'content': continue + content += 1 + if div.getAttribute('xml:lang') == 'en-us': lang += 1 + html.close() + self.assertEqual(3, lang) + self.assertEqual(12, content) diff --git a/tests/test_rlists.py b/tests/test_rlists.py index 8b27bc9..155b7df 100644 --- a/tests/test_rlists.py +++ b/tests/test_rlists.py @@ -21,8 +21,8 @@ class ReadingListTest(unittest.TestCase): def test_feeds(self): feeds = [split(feed)[1] for feed in config.feeds()] feeds.sort() - self.assertEqual(['testfeed1a.atom', 'testfeed2.atom', 'testfeed3.rss'], - feeds) + self.assertEqual(['testfeed0.atom', 'testfeed1a.atom', + 'testfeed2.atom', 'testfeed3.rss'], feeds) # dictionaries @@ -49,5 +49,5 @@ class ReadingListTest(unittest.TestCase): feeds = [split(feed)[1] for feed in parser.sections()] feeds.sort() - self.assertEqual(['testfeed1a.atom', 'testfeed2.atom', 'testfeed3.rss'], - feeds) + self.assertEqual(['testfeed0.atom', 'testfeed1a.atom', + 'testfeed2.atom', 'testfeed3.rss'], feeds) diff --git a/tests/test_splice.py b/tests/test_splice.py index 99fb446..b34236e 100644 --- a/tests/test_splice.py +++ b/tests/test_splice.py @@ -10,8 +10,8 @@ class SpliceTest(unittest.TestCase): def test_splice(self): doc = splice(configfile) self.assertEqual(12,len(doc.getElementsByTagName('entry'))) - self.assertEqual(3,len(doc.getElementsByTagName('planet:source'))) - self.assertEqual(15,len(doc.getElementsByTagName('planet:name'))) + self.assertEqual(4,len(doc.getElementsByTagName('planet:source'))) + self.assertEqual(16,len(doc.getElementsByTagName('planet:name'))) self.assertEqual('test planet', doc.getElementsByTagName('title')[0].firstChild.nodeValue)