Permalink
Browse files

Added blacklist test

  • Loading branch information...
1 parent 6458d7e commit f900398c9fe0f734edb3d4f30a68a0d4d5588ce1 @m94mni m94mni committed Jun 2, 2010
Showing with 22 additions and 0 deletions.
  1. +1 −0 tests/data/spider/config.ini
  2. +21 −0 tests/test_spider.py
@@ -1,6 +1,7 @@
[Planet]
name = test planet
cache_directory = tests/work/spider/cache
+cache_blasklist_directory = tests/work/spider/cache/blacklist
[tests/data/spider/testfeed0.atom]
name = not found
View
@@ -82,6 +82,27 @@ def test_spiderFeed_retroactive_filter(self):
self.spiderFeed(testfeed % '1b')
self.assertEqual(1, len(glob.glob(workdir+"/*")))
+ def test_spiderFeed_blacklist(self):
+ config.load(configfile)
+ self.spiderFeed(testfeed % '1b')
+
+ # verify that exactly four entries were produced
+ self.assertEqual(4, len(glob.glob(workdir+"/planet*")))
+
+ # verify that the file names are as expected
+ self.assertTrue(os.path.exists(os.path.join(workdir,
+ 'planet.intertwingly.net,2006,testfeed1,1')))
+
+ os.mkdir(os.path.join(workdir, "blacklist"))
+
+ os.rename(os.path.join(workdir,
+ 'planet.intertwingly.net,2006,testfeed1,1'),
+ os.path.join(workdir, "blacklist",
+ 'planet.intertwingly.net,2006,testfeed1,1'))
+
+ self.spiderFeed(testfeed % '1b')
+ self.assertEqual(3, len(glob.glob(workdir+"/planet*")))
+
def test_spiderUpdate(self):
config.load(configfile)
self.spiderFeed(testfeed % '1a')

0 comments on commit f900398

Please sign in to comment.