Commit 581204e5 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Event test inherit from NeoTestBase


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@524 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bc4b6b79
......@@ -17,11 +17,12 @@
import unittest, os
from mock import Mock
from time import time
from neo.tests.base import NeoTestBase
from neo.epoll import Epoll
from neo.event import EpollEventManager, IdleEvent
from neo.protocol import Packet, PING
class testEvent(unittest.TestCase):
class testEvent(NeoTestBase):
def setUp(self):
pass
......@@ -29,11 +30,6 @@ class testEvent(unittest.TestCase):
def tearDown(self):
pass
def checkNoPacketSent(self, conn):
self.assertEquals(len(conn.mockGetNamedCalls('notify')), 0)
self.assertEquals(len(conn.mockGetNamedCalls('answer')), 0)
self.assertEquals(len(conn.mockGetNamedCalls('ask')), 0)
def test_01_EpollEventManager(self):
# init one
em = EpollEventManager()
......@@ -169,10 +165,7 @@ class testEvent(unittest.TestCase):
self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 1)
self.assertEquals(len(handler.mockGetNamedCalls("timeoutExpired")), 0)
# check ping packet sent
call = conn.mockGetNamedCalls("ask")[0]
packet = call.getParam(0)
self.failUnless(isinstance(packet, Packet))
self.assertEqual(packet.getType(), PING)
self.checkAskPacket(conn, PING)
# call with time < critical_time < t
t = critical_time + 5
......
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