From 0e123b9e09e8bfd55d611a08abfc1b8544bb30f0 Mon Sep 17 00:00:00 2001 From: Kimmo Huoman Date: Tue, 24 Feb 2015 12:03:32 +0200 Subject: [PATCH] Remove items-table from RSS database when removing feed. --- pyfibot/modules/module_rss.py | 1 + tests/test_rss.py | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/pyfibot/modules/module_rss.py b/pyfibot/modules/module_rss.py index 0dc1dda..67eb8e7 100644 --- a/pyfibot/modules/module_rss.py +++ b/pyfibot/modules/module_rss.py @@ -77,6 +77,7 @@ def remove_feed(network, channel, id): if not f: return DATABASE['feeds'].delete(id=f.id) + DATABASE['items_%i' % (f.id)].drop() return f diff --git a/tests/test_rss.py b/tests/test_rss.py index 4f80388..760281c 100644 --- a/tests/test_rss.py +++ b/tests/test_rss.py @@ -65,23 +65,14 @@ def test_command_remove(): ('#pyfibot', 'only "latest" and "list" available for non-admins'), command_rss(bot, 'pyfibot!pyfibot@example.example.com', '#pyfibot', 'remove') ) - - -def test_command_remove_2(): eq_( ('#pyfibot', 'syntax: ".rss remove "'), command_rss(bot, ADMIN_USER, '#pyfibot', 'remove') ) - - -def test_command_remove_3(): eq_( ('#pyfibot', 'feed not found, no action taken'), command_rss(bot, ADMIN_USER, '#pyfibot', 'remove 123') ) - - -def test_command_remove_4(): eq_( ('#pyfibot', 'feed "Uutiset - Ampparit.com" <./tests/static/test_rss_check.xml> removed'), command_rss(bot, ADMIN_USER, '#pyfibot', 'remove 1')