mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
refactor plugins
This commit is contained in:
@@ -6,8 +6,7 @@ TODO: test all plugins, maybe declare their sample input somewhere near the code
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
|
||||
import mock as mock
|
||||
from collections import namedtuple
|
||||
|
||||
from common import buckets, rate_limit, RATE_GLOBAL
|
||||
|
||||
@@ -23,8 +22,6 @@ class TestEventlooper(unittest.TestCase):
|
||||
self.assertEqual(result, (None, None))
|
||||
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
Bucket = namedtuple("BucketConfig", ["history", "period", "max_hist_len"])
|
||||
|
||||
|
||||
@@ -235,7 +232,7 @@ class TestPlugins(unittest.TestCase):
|
||||
self.assertTrue(all(['msg' in result['presence'], 'status' in result['presence']]))
|
||||
|
||||
def test_teatimer(self):
|
||||
from plugins import command_teatimer
|
||||
from plugins.commands import command_teatimer
|
||||
result = command_teatimer(['teatimer'], reply_user='hans')
|
||||
self.assertIn('event', result)
|
||||
self.assertIn('time', result['event'])
|
||||
@@ -303,5 +300,3 @@ class TestPlugins(unittest.TestCase):
|
||||
if 'DERPDERP' in config.runtime_config_store['other_bots']:
|
||||
config.runtime_config_store['other_bots'].remove('DERPDERP')
|
||||
config.runtime_config_store.write()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user