Example #1
0
def test_init():
    eq_(('#pyfibot', 'feed added with 50 items'),
        command_rss(bot, ADMIN_USER, '#pyfibot',
                    'add ./tests/static/test_rss_init.xml'))
    eq_((
        '#pyfibot',
        '[Uutiset - Ampparit] Tuuli riepotteli Rosbergiakin (Yle) <http://www.ampparit.com/redir.php?id=237104024>'
    ), command_rss(bot, ADMIN_USER, '#pyfibot', 'latest 1'))
Example #2
0
def test_command_remove():
    eq_(
        ('#pyfibot', 'only "latest" and "list" available for non-admins'),
        command_rss(bot, '[email protected]', '#pyfibot', 'remove')
    )
    eq_(
        ('#pyfibot', 'syntax: ".rss remove <id from list>"'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'remove')
    )
    eq_(
        ('#pyfibot', 'feed not found, no action taken'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'remove 123')
    )
    eq_(
        ('#pyfibot', 'feed "Uutiset - Ampparit.com" <./tests/static/test_rss_check.xml> removed'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'remove 1')
    )
Example #3
0
def test_update():
    global f
    f = Feed('nerv', '#pyfibot', url=r'./tests/static/test_rss_init.xml')
    f.update_feed_info({'url': r'./tests/static/test_rss_check.xml'})
    eq_(
        None,
        command_rss(bot, ADMIN_USER, '#pyfibot', 'update 1')
    )
Example #4
0
def test_add_feed():
    check_re(
        r'feed added with \d+ items',
        command_rss(bot, ADMIN_USER, '#pyfibot', 'add http://feeds.feedburner.com/ampparit-kaikki?format=xml')[1]
    )
Example #5
0
def test_command_latest():
    eq_(
        ('#pyfibot', '[Uutiset - Ampparit] Turun Ruisrock käynnistyi aurinkoisessa säässä (Karjalainen) <http://www.ampparit.com/redir.php?id=1198870394>'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'latest 1')
    )
Example #6
0
def test_add_feed():
    check_re(
        r'feed added with \d+ items',
        command_rss(
            bot, ADMIN_USER, '#pyfibot',
            'add http://feeds.feedburner.com/ampparit-kaikki?format=xml')[1])
Example #7
0
def test_command_remove_3():
    eq_(
        ('#pyfibot', 'feed not found, no action taken'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'remove 123')
    )
Example #8
0
def test_command_add():
    check_re(
        r'feed added with \d+ items',
        command_rss(bot, ADMIN_USER, '#pyfibot', 'add ./tests/static/test_rss_init.xml')[1]
    )
Example #9
0
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'))
Example #10
0
def test_command_remove():
    eq_(
        ('#pyfibot', 'only "latest" and "list" available for non-admins'),
        command_rss(bot, '[email protected]', '#pyfibot', 'remove')
    )
Example #11
0
def test_command_remove_2():
    eq_(('#pyfibot', 'syntax: ".rss remove <id from list>"'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'remove'))
Example #12
0
def test_command_remove_3():
    eq_(('#pyfibot', 'feed not found, no action taken'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'remove 123'))
Example #13
0
def test_command_remove():
    eq_(('#pyfibot', 'only "latest" and "list" available for non-admins'),
        command_rss(bot, '[email protected]', '#pyfibot',
                    'remove'))
Example #14
0
def test_command_list():
    eq_(None, command_rss(bot, ADMIN_USER, '#pyfibot', 'list'))
Example #15
0
def test_command():
    eq_(
        bot.say(
            '#pyfibot',
            'rss: valid arguments are [list, add, remove, latest, update]'),
        command_rss(bot, '[email protected]', '#pyfibot', ''))
Example #16
0
def test_command():
    eq_(bot.say('#pyfibot', 'rss: valid arguments are [list, add, remove, latest, update]'), command_rss(bot, '[email protected]', '#pyfibot', ''))
Example #17
0
def test_command_add():
    check_re(
        r'feed added with \d+ items',
        command_rss(bot, ADMIN_USER, '#pyfibot',
                    'add ./tests/static/test_rss_init.xml')[1])
Example #18
0
def test_command_list():
    eq_(None, command_rss(bot, ADMIN_USER, '#pyfibot', 'list'))
Example #19
0
def test_command_add_2():
    eq_(('#pyfibot', 'feed already added'),
        command_rss(bot, ADMIN_USER, '#pyfibot',
                    'add ./tests/static/test_rss_init.xml'))
Example #20
0
def test_command_remove_2():
    eq_(
        ('#pyfibot', 'syntax: ".rss remove <id from list>"'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'remove')
    )
Example #21
0
def test_update():
    global f
    f = Feed('nerv', '#pyfibot', url=r'./tests/static/test_rss_init.xml')
    f.update_feed_info({'url': r'./tests/static/test_rss_check.xml'})
    eq_(None, command_rss(bot, ADMIN_USER, '#pyfibot', 'update 1'))
Example #22
0
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')
    )
Example #23
0
def test_init():
    eq_(('#pyfibot', 'feed added with 50 items'), command_rss(bot, ADMIN_USER, '#pyfibot', 'add ./tests/static/test_rss_init.xml'))
    eq_(
        ('#pyfibot', '[Uutiset - Ampparit] Tuuli riepotteli Rosbergiakin (Yle) <http://www.ampparit.com/redir.php?id=237104024>'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'latest 1')
    )
Example #24
0
def test_command_add_2():
    eq_(
        ('#pyfibot', 'feed already added'),
        command_rss(bot, ADMIN_USER, '#pyfibot', 'add ./tests/static/test_rss_init.xml')
    )
Example #25
0
def test_command_latest():
    eq_((
        '#pyfibot',
        '[Uutiset - Ampparit] Turun Ruisrock käynnistyi aurinkoisessa säässä (Karjalainen) <http://www.ampparit.com/redir.php?id=1198870394>'
    ), command_rss(bot, ADMIN_USER, '#pyfibot', 'latest 1'))