summaryrefslogtreecommitdiff
path: root/python/tests/connection.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-01-08 18:27:39 +0000
committerRafael H. Schloming <rhs@apache.org>2009-01-08 18:27:39 +0000
commit5f5b7cbf6a266ae471c32b07457e38a7f11cdf46 (patch)
treedb58078e0f88220fb0388ca1662b5ba9a9763035 /python/tests/connection.py
parent64bd79537e385a045b3c74de95ddd19f91163a26 (diff)
downloadqpid-python-5f5b7cbf6a266ae471c32b07457e38a7f11cdf46.tar.gz
ignore hearbeat controls rather than barfing on them, also permit the heartbeat to be specified on connection creation
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@732778 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests/connection.py')
-rw-r--r--python/tests/connection.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/python/tests/connection.py b/python/tests/connection.py
index 512fa62189..19cdad9f97 100644
--- a/python/tests/connection.py
+++ b/python/tests/connection.py
@@ -25,7 +25,6 @@ from qpid.datatypes import Message
from qpid.testlib import testrunner
from qpid.delegates import Server
from qpid.queue import Queue
-from qpid.spec010 import load
from qpid.session import Delegate
PORT = 1234
@@ -62,13 +61,14 @@ class TestSession(Delegate):
cmd.acquire_mode, m)
elif cmd.destination == "abort":
self.session.channel.connection.sock.close()
+ elif cmd.destination == "heartbeat":
+ self.session.channel.connection_heartbeat()
else:
self.queue.put((cmd, headers, body))
class ConnectionTest(TestCase):
def setUp(self):
- self.spec = load(testrunner.get_spec_file("amqp.0-10.xml"))
self.queue = Queue()
self.running = True
started = Event()
@@ -76,7 +76,7 @@ class ConnectionTest(TestCase):
def run():
ts = TestServer(self.queue)
for s in listen("0.0.0.0", PORT, lambda: self.running, lambda: started.set()):
- conn = Connection(s, self.spec, ts.connection)
+ conn = Connection(s, delegate=ts.connection)
try:
conn.start(5)
except Closed:
@@ -94,8 +94,8 @@ class ConnectionTest(TestCase):
connect("0.0.0.0", PORT).close()
self.server.join(3)
- def connect(self):
- return Connection(connect("0.0.0.0", PORT), self.spec)
+ def connect(self, **kwargs):
+ return Connection(connect("0.0.0.0", PORT), **kwargs)
def test(self):
c = self.connect()
@@ -213,3 +213,10 @@ class ConnectionTest(TestCase):
s.auto_sync = False
s.message_transfer("echo", message=Message("test"))
s.sync(10)
+
+ def testHeartbeat(self):
+ c = self.connect(heartbeat=10)
+ c.start(10)
+ s = c.session("test")
+ s.channel.connection_heartbeat()
+ s.message_transfer("heartbeat")