missed the file :)
This commit is contained in:
parent
a180835028
commit
fbb9bdf7ff
29
test/test_callbacks.py
Normal file
29
test/test_callbacks.py
Normal file
@ -0,0 +1,29 @@
|
||||
import unittest
|
||||
|
||||
|
||||
from shoebox import handlers
|
||||
|
||||
|
||||
class FooCallback(handlers.ArchiveCallback):
|
||||
pass
|
||||
|
||||
|
||||
class BlahCallback(handlers.ArchiveCallback):
|
||||
pass
|
||||
|
||||
|
||||
class TestCallbackList(unittest.TestCase):
|
||||
def test_list(self):
|
||||
config = {"callback_list": "test|test_callbacks:FooCallback,"
|
||||
"shoebox.handlers:ChangeExtensionCallback, "
|
||||
"%s:BlahCallback" % __name__}
|
||||
c = handlers.CallbackList(**config)
|
||||
|
||||
# Note: isinstance will fail for this check because it's technically a
|
||||
# different class since it comes from a different module i
|
||||
# (the 'test' module).
|
||||
self.assertTrue("FooCallback" in str(type(c.callbacks[0])))
|
||||
self.assertTrue(isinstance(c.callbacks[1],
|
||||
handlers.ChangeExtensionCallback))
|
||||
self.assertTrue(isinstance(c.callbacks[2], BlahCallback))
|
||||
|
Loading…
x
Reference in New Issue
Block a user