Commit 31b3268b authored by Vincent Pelletier's avatar Vincent Pelletier

Allow restricting test by packet type.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2149 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6a6cfaa8
......@@ -204,11 +204,19 @@ class NeoTestBase(unittest.TestCase):
""" Ensure the connection was not closed """
self.assertEquals(len(conn.mockGetNamedCalls('close')), 0)
def checkNoPacketSent(self, conn):
def _checkNoPacketSend(self, conn, method_id):
call_list = conn.mockGetNamedCalls(method_id)
self.assertEquals(len(call_list), 0, call_list)
def checkNoPacketSent(self, conn, check_notify=True, check_answer=True,
check_ask=True):
""" check if no packet were sent """
self.assertEquals(len(conn.mockGetNamedCalls('notify')), 0)
self.assertEquals(len(conn.mockGetNamedCalls('answer')), 0)
self.assertEquals(len(conn.mockGetNamedCalls('ask')), 0)
if check_notify:
self._checkNoPacketSend(conn, 'notify')
if check_answer:
self._checkNoPacketSend(conn, 'answer')
if check_ask:
self._checkNoPacketSend(conn, 'ask')
def checkNoUUIDSet(self, conn):
""" ensure no UUID was set on the connection """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment