Commit e8db4fc3 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix tests that fails since bug fix #490 (send renamed as notify)


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@491 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent aa81e97c
...@@ -194,14 +194,13 @@ server: 127.0.0.1:10023 ...@@ -194,14 +194,13 @@ server: 127.0.0.1:10023
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
"""Check the abort method has been called and an error packet has been sent""" """Check the abort method has been called and an error packet has been sent"""
# sometimes we answer an error, sometimes we just send it # sometimes we answer an error, sometimes we just notify it
send_calls_len = len(conn.mockGetNamedCalls("send")) notify_calls_len = len(conn.mockGetNamedCalls("notify"))
answer_calls_len = len(conn.mockGetNamedCalls('answer')) answer_calls_len = len(conn.mockGetNamedCalls('answer'))
self.assertEquals(send_calls_len + answer_calls_len, 1) self.assertEquals(notify_calls_len + answer_calls_len, 1)
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1)
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) if notify_calls_len == 1:
if send_calls_len == 1: call = conn.mockGetNamedCalls("notify")[packet_number]
call = conn.mockGetNamedCalls("send")[packet_number]
else: else:
call = conn.mockGetNamedCalls("answer")[packet_number] call = conn.mockGetNamedCalls("answer")[packet_number]
packet = call.getParam(0) packet = call.getParam(0)
......
...@@ -174,12 +174,12 @@ server: 127.0.0.1:10023 ...@@ -174,12 +174,12 @@ server: 127.0.0.1:10023
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
"""Check the abort method has been called and an error packet has been sent""" """Check the abort method has been called and an error packet has been sent"""
send_calls_len = len(conn.mockGetNamedCalls("send")) notify_calls_len = len(conn.mockGetNamedCalls("notify"))
answer_calls_len = len(conn.mockGetNamedCalls('answer')) answer_calls_len = len(conn.mockGetNamedCalls('answer'))
self.assertEquals(send_calls_len + answer_calls_len, 1) self.assertEquals(notify_calls_len + answer_calls_len, 1)
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1)
if send_calls_len == 1: if notify_calls_len == 1:
call = conn.mockGetNamedCalls("send")[packet_number] call = conn.mockGetNamedCalls("notify")[packet_number]
else: else:
call = conn.mockGetNamedCalls("answer")[packet_number] call = conn.mockGetNamedCalls("answer")[packet_number]
packet = call.getParam(0) packet = call.getParam(0)
......
...@@ -119,12 +119,12 @@ server: 127.0.0.1:10023 ...@@ -119,12 +119,12 @@ server: 127.0.0.1:10023
# Method to test the kind of packet returned in answer # Method to test the kind of packet returned in answer
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
"""Check the abort method has been called and an error packet has been sent""" """Check the abort method has been called and an error packet has been sent"""
# sometimes we answer an error, sometimes we just send it # sometimes we answer an error, sometimes we just notify it
send_calls_len = len(conn.mockGetNamedCalls("send")) notify_calls_len = len(conn.mockGetNamedCalls("notify"))
answer_calls_len = len(conn.mockGetNamedCalls('answer')) answer_calls_len = len(conn.mockGetNamedCalls('answer'))
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1)
if send_calls_len == 1: if notify_calls_len == 1:
call = conn.mockGetNamedCalls("send")[packet_number] call = conn.mockGetNamedCalls("notify")[packet_number]
else: else:
call = conn.mockGetNamedCalls("answer")[packet_number] call = conn.mockGetNamedCalls("answer")[packet_number]
packet = call.getParam(0) packet = call.getParam(0)
......
...@@ -178,12 +178,12 @@ server: 127.0.0.1:10023 ...@@ -178,12 +178,12 @@ server: 127.0.0.1:10023
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
"""Check the abort method has been called and an error packet has been sent""" """Check the abort method has been called and an error packet has been sent"""
# sometimes we answer an error, sometimes we just send it # sometimes we answer an error, sometimes we just send it
send_calls_len = len(conn.mockGetNamedCalls("send")) notify_calls_len = len(conn.mockGetNamedCalls("notify"))
answer_calls_len = len(conn.mockGetNamedCalls('answer')) answer_calls_len = len(conn.mockGetNamedCalls('answer'))
self.assertEquals(send_calls_len + answer_calls_len, 1) self.assertEquals(notify_calls_len + answer_calls_len, 1)
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1)
if send_calls_len == 1: if notify_calls_len == 1:
call = conn.mockGetNamedCalls("send")[packet_number] call = conn.mockGetNamedCalls("notify")[packet_number]
else: else:
call = conn.mockGetNamedCalls("answer")[packet_number] call = conn.mockGetNamedCalls("answer")[packet_number]
packet = call.getParam(0) packet = call.getParam(0)
......
...@@ -121,14 +121,14 @@ server: 127.0.0.1:10020 ...@@ -121,14 +121,14 @@ server: 127.0.0.1:10020
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
"""Check the abort method has been called and an error packet has been sent""" """Check the abort method has been called and an error packet has been sent"""
# sometimes we answer an error, sometimes we just send it # sometimes we answer an error, sometimes we just notify it
send_calls_len = len(conn.mockGetNamedCalls("send")) notify_calls_len = len(conn.mockGetNamedCalls("notify"))
answer_calls_len = len(conn.mockGetNamedCalls('answer')) answer_calls_len = len(conn.mockGetNamedCalls('answer'))
self.assertEquals(send_calls_len + answer_calls_len, 1) self.assertEquals(notify_calls_len + answer_calls_len, 1)
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1)
self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 0) self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 0)
if send_calls_len == 1: if notify_calls_len == 1:
call = conn.mockGetNamedCalls("send")[packet_number] call = conn.mockGetNamedCalls("notify")[packet_number]
else: else:
call = conn.mockGetNamedCalls("answer")[packet_number] call = conn.mockGetNamedCalls("answer")[packet_number]
packet = call.getParam(0) packet = call.getParam(0)
......
...@@ -53,13 +53,13 @@ class StorageOperationTests(unittest.TestCase): ...@@ -53,13 +53,13 @@ class StorageOperationTests(unittest.TestCase):
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
"""Check the abort method has been called and an error packet has been sent""" """Check the abort method has been called and an error packet has been sent"""
# sometimes we answer an error, sometimes we just send it # sometimes we answer an error, sometimes we just send it
send_calls_len = len(conn.mockGetNamedCalls("send")) notify_calls_len = len(conn.mockGetNamedCalls("notify"))
answer_calls_len = len(conn.mockGetNamedCalls('answer')) answer_calls_len = len(conn.mockGetNamedCalls('answer'))
self.assertEquals(send_calls_len + answer_calls_len, 1) self.assertEquals(notify_calls_len + answer_calls_len, 1)
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1)
self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 0) self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 0)
if send_calls_len == 1: if notify_calls_len == 1:
call = conn.mockGetNamedCalls("send")[packet_number] call = conn.mockGetNamedCalls("notify")[packet_number]
else: else:
call = conn.mockGetNamedCalls("answer")[packet_number] call = conn.mockGetNamedCalls("answer")[packet_number]
packet = call.getParam(0) packet = call.getParam(0)
......
...@@ -129,14 +129,14 @@ server: 127.0.0.1:10020 ...@@ -129,14 +129,14 @@ server: 127.0.0.1:10020
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
"""Check the abort method has been called and an error packet has been sent""" """Check the abort method has been called and an error packet has been sent"""
# sometimes we answer an error, sometimes we just send it # sometimes we answer an error, sometimes we just notify it
send_calls_len = len(conn.mockGetNamedCalls("send")) notify_calls_len = len(conn.mockGetNamedCalls("notify"))
answer_calls_len = len(conn.mockGetNamedCalls('answer')) answer_calls_len = len(conn.mockGetNamedCalls('answer'))
self.assertEquals(send_calls_len + answer_calls_len, 1) self.assertEquals(notify_calls_len + answer_calls_len, 1)
self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1) self.assertEquals(len(conn.mockGetNamedCalls("abort")), 1)
self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 0) self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 0)
if send_calls_len == 1: if notify_calls_len == 1:
call = conn.mockGetNamedCalls("send")[packet_number] call = conn.mockGetNamedCalls("notify")[packet_number]
else: else:
call = conn.mockGetNamedCalls("answer")[packet_number] call = conn.mockGetNamedCalls("answer")[packet_number]
packet = call.getParam(0) packet = call.getParam(0)
......
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