def assert_raises_multi_regex(
self, expected_exception, expected_regexp, callable_obj=None,
*args, **kwargs):
"""
Custom function to backport assertRaisesRegexp to all supported
versions of Python.
"""
self.assertRaises(expected_exception, callable_obj, *args, **kwargs)
try:
callable_obj(*args)
except facebook.GraphAPIError as error:
self.assertEqual(error.message, expected_regexp)
评论列表
文章目录