added support for rpm packaging and basic support for deb
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import unittest
|
||||
|
||||
from huey.utils import wrap_exception
|
||||
|
||||
|
||||
class MyException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class TestWrapException(unittest.TestCase):
|
||||
def test_wrap_exception(self):
|
||||
def raise_keyerror():
|
||||
try:
|
||||
{}['huey']
|
||||
except KeyError as exc:
|
||||
raise wrap_exception(MyException)
|
||||
|
||||
self.assertRaises(MyException, raise_keyerror)
|
||||
try:
|
||||
raise_keyerror()
|
||||
except MyException as exc:
|
||||
self.assertEqual(str(exc), "KeyError: 'huey'")
|
||||
else:
|
||||
assert False
|
||||
Reference in New Issue
Block a user