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

Update test for master/election.py according to commit #416


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@420 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent c0537bd3
...@@ -306,8 +306,8 @@ server: 127.0.0.1:10023 ...@@ -306,8 +306,8 @@ server: 127.0.0.1:10023
"127.0.0.1", "127.0.0.1",
self.master_port, self.master_port,
1009, 1009,
2 2,
) self.app.uuid)
conn = ClientConnection(self.app.em, self.election, addr = ("127.0.0.1", self.master_port), conn = ClientConnection(self.app.em, self.election, addr = ("127.0.0.1", self.master_port),
connector_handler = DoNothingConnector) connector_handler = DoNothingConnector)
...@@ -334,7 +334,9 @@ server: 127.0.0.1:10023 ...@@ -334,7 +334,9 @@ server: 127.0.0.1:10023
self.assertEqual(len(conn.getConnector().mockGetNamedCalls("addPacket")),1) self.assertEqual(len(conn.getConnector().mockGetNamedCalls("addPacket")),1)
self.election.handleAcceptNodeIdentification(conn, p, STORAGE_NODE_TYPE, self.election.handleAcceptNodeIdentification(conn, p, STORAGE_NODE_TYPE,
uuid, "127.0.0.1", self.master_port, uuid, "127.0.0.1", self.master_port,
self.app.num_partitions, self.app.num_replicas self.app.num_partitions,
self.app.num_replicas,
self.app.uuid
) )
self.assertEqual(conn.getConnector(), None) self.assertEqual(conn.getConnector(), None)
self.assertEqual(len(self.app.unconnected_master_node_set), 0) self.assertEqual(len(self.app.unconnected_master_node_set), 0)
...@@ -353,8 +355,9 @@ server: 127.0.0.1:10023 ...@@ -353,8 +355,9 @@ server: 127.0.0.1:10023
self.assertEqual(len(conn.getConnector().mockGetNamedCalls("addPacket")),1) self.assertEqual(len(conn.getConnector().mockGetNamedCalls("addPacket")),1)
self.election.handleAcceptNodeIdentification(conn, p, STORAGE_NODE_TYPE, self.election.handleAcceptNodeIdentification(conn, p, STORAGE_NODE_TYPE,
uuid, "127.0.0.2", self.master_port, uuid, "127.0.0.2", self.master_port,
self.app.num_partitions, self.app.num_replicas self.app.num_partitions,
) self.app.num_replicas,
self.app.uuid)
self.assertEqual(conn.getConnector(), None) self.assertEqual(conn.getConnector(), None)
def test_08_handleAcceptNodeIdentification3(self): def test_08_handleAcceptNodeIdentification3(self):
...@@ -371,8 +374,9 @@ server: 127.0.0.1:10023 ...@@ -371,8 +374,9 @@ server: 127.0.0.1:10023
self.election.handleAcceptNodeIdentification(conn, p, MASTER_NODE_TYPE, self.election.handleAcceptNodeIdentification(conn, p, MASTER_NODE_TYPE,
uuid, "127.0.0.1", self.master_port, uuid, "127.0.0.1", self.master_port,
self.app.num_partitions, self.app.num_replicas self.app.num_partitions,
) self.app.num_replicas,
self.app.uuid)
self.assertEqual(self.app.nm.getNodeByServer(conn.getAddress()).getUUID(), uuid) self.assertEqual(self.app.nm.getNodeByServer(conn.getAddress()).getUUID(), uuid)
self.assertEqual(conn.getUUID(), uuid) self.assertEqual(conn.getUUID(), uuid)
self.assertEqual(len(conn.getConnector().mockGetNamedCalls("addPacket")),2) self.assertEqual(len(conn.getConnector().mockGetNamedCalls("addPacket")),2)
......
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