mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 10:34:19 +01:00
* added assertActionRegexp (semi-tested, not thoroughly tested)
This commit is contained in:
parent
a63ee1e304
commit
2ddb080a73
@ -243,6 +243,14 @@ class PluginTestCase(unittest.TestCase):
|
|||||||
if expectedResponse is not None:
|
if expectedResponse is not None:
|
||||||
self.assertEqual(ircmsgs.unAction(m), expectedResponse)
|
self.assertEqual(ircmsgs.unAction(m), expectedResponse)
|
||||||
|
|
||||||
|
def assertActionRegexp(self, query, regexp, flags=re.I):
|
||||||
|
m = self._feedMsg(query)
|
||||||
|
if m is None:
|
||||||
|
raise TimeoutError, query
|
||||||
|
self.failUnless(ircmsgs.isAction(m))
|
||||||
|
self.failUnless(re.search(regexp, ircmsgs.unAction(m), flags),
|
||||||
|
'%r does not match %r' % (ircmsgs.unAction(m),
|
||||||
|
regexp))
|
||||||
|
|
||||||
class ChannelPluginTestCase(PluginTestCase):
|
class ChannelPluginTestCase(PluginTestCase):
|
||||||
channel = '#test'
|
channel = '#test'
|
||||||
|
Loading…
Reference in New Issue
Block a user