summaryrefslogtreecommitdiff
path: root/python/tests_0-10
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests_0-10')
-rw-r--r--python/tests_0-10/broker.py22
-rw-r--r--python/tests_0-10/dtx.py40
-rw-r--r--python/tests_0-10/exchange.py2
-rw-r--r--python/tests_0-10/execution.py2
-rw-r--r--python/tests_0-10/queue.py20
-rw-r--r--python/tests_0-10/tx.py4
6 files changed, 36 insertions, 54 deletions
diff --git a/python/tests_0-10/broker.py b/python/tests_0-10/broker.py
index 0df7eb09fa..99936ba742 100644
--- a/python/tests_0-10/broker.py
+++ b/python/tests_0-10/broker.py
@@ -101,29 +101,11 @@ class BrokerTests(TestBase):
def test_closed_channel(self):
channel = self.client.channel(200)
- channel.channel_open()
- channel.channel_close()
+ channel.session_open()
+ channel.session_close()
try:
channel.queue_declare(exclusive=True)
self.fail("Expected error on queue_declare for closed channel")
except Closed, e:
if isinstance(e.args[0], str): self.fail(e)
self.assertConnectionException(504, e.args[0])
-
- def test_channel_flow(self):
- channel = self.channel
- channel.queue_declare(queue="flow_test_queue", exclusive=True)
- self.subscribe(destination="my-tag", queue="flow_test_queue")
- incoming = self.client.queue("my-tag")
-
- channel.channel_flow(active=False)
- c = Content("abcdefghijklmnopqrstuvwxyz", properties = {"routing_key" : "flow_test_queue"})
- channel.message_transfer(content = c)
- try:
- incoming.get(timeout=1)
- self.fail("Received message when flow turned off.")
- except Empty: None
-
- channel.channel_flow(active=True)
- msg = incoming.get(timeout=1)
- self.assertEqual("abcdefghijklmnopqrstuvwxyz", msg.content.body)
diff --git a/python/tests_0-10/dtx.py b/python/tests_0-10/dtx.py
index b5645cb596..000eddff21 100644
--- a/python/tests_0-10/dtx.py
+++ b/python/tests_0-10/dtx.py
@@ -43,8 +43,9 @@ class DtxTests(TestBase):
tx_counter = 0
def reset_channel(self):
- self.channel.channel_close()
- self.channel.channel_open()
+ self.channel.session_close()
+ self.channel = self.client.channel(self.channel.id + 1)
+ self.channel.session_open()
def test_simple_commit(self):
"""
@@ -171,7 +172,7 @@ class DtxTests(TestBase):
other = self.connect()
channel2 = other.channel(1)
- channel2.channel_open()
+ channel2.session_open()
channel2.dtx_demarcation_select()
#create a xid
@@ -202,17 +203,16 @@ class DtxTests(TestBase):
Verify that a xid is 'forgotten' - and can therefore be used
again - once it is completed.
"""
- channel = self.channel
#do some transactional work & complete the transaction
self.test_simple_commit()
# channel has been reset, so reselect for use with dtx
- channel.dtx_demarcation_select()
+ self.channel.dtx_demarcation_select()
#start association for the same xid as the previously completed txn
tx = self.xid("my-xid")
- channel.dtx_demarcation_start(xid=tx)
- channel.dtx_demarcation_end(xid=tx)
- channel.dtx_coordination_rollback(xid=tx)
+ self.channel.dtx_demarcation_start(xid=tx)
+ self.channel.dtx_demarcation_end(xid=tx)
+ self.channel.dtx_coordination_rollback(xid=tx)
def test_start_join_and_resume(self):
"""
@@ -242,7 +242,7 @@ class DtxTests(TestBase):
channel1.dtx_demarcation_select()
channel2 = self.client.channel(2)
- channel2.channel_open()
+ channel2.session_open()
channel2.dtx_demarcation_select()
#setup
@@ -323,9 +323,9 @@ class DtxTests(TestBase):
#cleanup
other = self.connect()
channel = other.channel(1)
- channel.channel_open()
+ channel.session_open()
channel.dtx_coordination_rollback(xid=tx)
- channel.channel_close()
+ channel.session_close()
other.close()
@@ -351,7 +351,7 @@ class DtxTests(TestBase):
operations are non-transactional
"""
channel = self.client.channel(2)
- channel.channel_open()
+ channel.session_open()
channel.queue_declare(queue="tx-queue", exclusive=True)
#publish a message under a transaction
@@ -372,7 +372,7 @@ class DtxTests(TestBase):
channel.message_cancel(destination="results")
#ack the message then close the channel
msg.complete()
- channel.channel_close()
+ channel.session_close()
channel = self.channel
#commit the transaction and check that the first message (and
@@ -388,7 +388,7 @@ class DtxTests(TestBase):
"""
other = self.connect()
tester = other.channel(1)
- tester.channel_open()
+ tester.session_open()
tester.queue_declare(queue="dummy", exclusive=True)
tester.dtx_demarcation_select()
tx = self.xid("dummy")
@@ -407,7 +407,7 @@ class DtxTests(TestBase):
self.channel.dtx_coordination_rollback(xid=tx)
self.assertConnectionException(503, e.args[0])
else:
- tester.channel_close()
+ tester.session_close()
other.close()
self.fail("Invalid use of one_phase=True, expected exception!")
@@ -422,7 +422,7 @@ class DtxTests(TestBase):
"""
other = self.connect()
tester = other.channel(1)
- tester.channel_open()
+ tester.session_open()
tester.queue_declare(queue="dummy", exclusive=True)
tester.dtx_demarcation_select()
tx = self.xid("dummy")
@@ -440,7 +440,7 @@ class DtxTests(TestBase):
self.channel.dtx_coordination_rollback(xid=tx)
self.assertConnectionException(503, e.args[0])
else:
- tester.channel_close()
+ tester.session_close()
other.close()
self.fail("Invalid use of one_phase=False, expected exception!")
@@ -452,7 +452,7 @@ class DtxTests(TestBase):
"""
channel1 = self.channel
channel2 = self.client.channel(2)
- channel2.channel_open()
+ channel2.session_open()
#setup:
channel2.queue_declare(queue="dummy", exclusive=True)
@@ -464,7 +464,7 @@ class DtxTests(TestBase):
channel2.message_get(queue="dummy", destination="dummy")
self.client.queue("dummy").get(timeout=1).complete()
channel2.message_transfer(content=Content(properties={'routing_key':"dummy"}, body="whatever"))
- channel2.channel_close()
+ channel2.session_close()
self.assertEqual(self.XA_RBROLLBACK, channel1.dtx_coordination_prepare(xid=tx).status)
channel1.dtx_coordination_rollback(xid=tx)
@@ -492,7 +492,7 @@ class DtxTests(TestBase):
"""
#open new channel to allow self.channel to be used in checking te queue
channel = self.client.channel(2)
- channel.channel_open()
+ channel.session_open()
#setup:
tx = self.xid("dummy")
channel.queue_declare(queue="queue-a", exclusive=True)
diff --git a/python/tests_0-10/exchange.py b/python/tests_0-10/exchange.py
index 4137eb7a51..4d8b254df7 100644
--- a/python/tests_0-10/exchange.py
+++ b/python/tests_0-10/exchange.py
@@ -322,6 +322,6 @@ class MiscellaneousErrorsTests(TestBase):
#cleanup
other = self.connect()
c2 = other.channel(1)
- c2.channel_open()
+ c2.session_open()
c2.exchange_delete(exchange="test_different_declared_type_exchange")
diff --git a/python/tests_0-10/execution.py b/python/tests_0-10/execution.py
index 9541369444..950ff59d97 100644
--- a/python/tests_0-10/execution.py
+++ b/python/tests_0-10/execution.py
@@ -25,5 +25,5 @@ class ExecutionTests (TestBase):
channel = self.channel
for i in [1, 2, 3]:
channel.basic_publish(routing_key=str(i))
- channel.execution_flush()
+ #channel.execution_flush()
assert(channel.completion.wait(channel.completion.command_id, timeout=1))
diff --git a/python/tests_0-10/queue.py b/python/tests_0-10/queue.py
index e3438116c8..ba017bb286 100644
--- a/python/tests_0-10/queue.py
+++ b/python/tests_0-10/queue.py
@@ -56,7 +56,7 @@ class QueueTests(TestBase):
#check error conditions (use new channels):
channel = self.client.channel(2)
- channel.channel_open()
+ channel.session_open()
try:
#queue specified but doesn't exist:
channel.queue_purge(queue="invalid-queue")
@@ -65,7 +65,7 @@ class QueueTests(TestBase):
self.assertChannelException(404, e.args[0])
channel = self.client.channel(3)
- channel.channel_open()
+ channel.session_open()
try:
#queue not specified and none previously declared for channel:
channel.queue_purge()
@@ -76,7 +76,7 @@ class QueueTests(TestBase):
#cleanup
other = self.connect()
channel = other.channel(1)
- channel.channel_open()
+ channel.session_open()
channel.exchange_delete(exchange="test-exchange")
def test_declare_exclusive(self):
@@ -88,7 +88,7 @@ class QueueTests(TestBase):
# Here we open a second separate connection:
other = self.connect()
c2 = other.channel(1)
- c2.channel_open()
+ c2.session_open()
#declare an exclusive queue:
c1.queue_declare(queue="exclusive-queue", exclusive="True")
@@ -141,7 +141,7 @@ class QueueTests(TestBase):
#need to reopen a channel:
channel = self.client.channel(2)
- channel.channel_open()
+ channel.session_open()
#try and bind non-existant queue:
try:
@@ -225,7 +225,7 @@ class QueueTests(TestBase):
#check attempted deletion of non-existant queue is handled correctly:
channel = self.client.channel(2)
- channel.channel_open()
+ channel.session_open()
try:
channel.queue_delete(queue="i-dont-exist", if_empty="True")
self.fail("Expected delete of non-existant queue to fail")
@@ -254,7 +254,7 @@ class QueueTests(TestBase):
#need new channel now:
channel = self.client.channel(2)
- channel.channel_open()
+ channel.session_open()
#empty queue:
self.subscribe(channel, destination="consumer_tag", queue="delete-me-2")
@@ -286,7 +286,7 @@ class QueueTests(TestBase):
#need new channel now:
channel2 = self.client.channel(2)
- channel2.channel_open()
+ channel2.session_open()
#try to delete, but only if empty:
try:
channel2.queue_delete(queue="delete-me-3", if_unused="True")
@@ -312,7 +312,7 @@ class QueueTests(TestBase):
channel = self.channel
other = self.connect()
channel2 = other.channel(1)
- channel2.channel_open()
+ channel2.session_open()
channel.queue_declare(queue="auto-delete-me", auto_delete=True)
@@ -321,7 +321,7 @@ class QueueTests(TestBase):
channel2.basic_consume(queue="auto-delete-me")
#implicit cancel
- channel2.channel_close()
+ channel2.session_close()
#check it is still there
channel.queue_declare(queue="auto-delete-me", passive=True)
diff --git a/python/tests_0-10/tx.py b/python/tests_0-10/tx.py
index 2415a88fb2..84c07d51c1 100644
--- a/python/tests_0-10/tx.py
+++ b/python/tests_0-10/tx.py
@@ -31,10 +31,10 @@ class TxTests(TestBase):
Test that commited publishes are delivered and commited acks are not re-delivered
"""
channel2 = self.client.channel(2)
- channel2.channel_open()
+ channel2.session_open()
self.perform_txn_work(channel2, "tx-commit-a", "tx-commit-b", "tx-commit-c")
channel2.tx_commit()
- channel2.channel_close()
+ channel2.session_close()
#use a different channel with new subscriptions to ensure
#there is no redelivery of acked messages: