summaryrefslogtreecommitdiff
path: root/python/tests/broker.py
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-09-22 09:53:47 +0000
committerGordon Sim <gsim@apache.org>2006-09-22 09:53:47 +0000
commit488beb5a2a072afe2be0c7a1f679a5049f3b2e19 (patch)
treeec5d2f70029800a12d3fdd6a91cc0169010a85ac /python/tests/broker.py
parent6225325010374b21f589e4daba8ddd48564786fa (diff)
downloadqpid-python-488beb5a2a072afe2be0c7a1f679a5049f3b2e19.tar.gz
Added tests for basic_cancel and for handling of invalid channel ids.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@448881 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/tests/broker.py')
-rw-r--r--python/tests/broker.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/tests/broker.py b/python/tests/broker.py
index 1345076604..307d447a6c 100644
--- a/python/tests/broker.py
+++ b/python/tests/broker.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+from qpid.client import Closed
from qpid.queue import Empty
from qpid.content import Content
from qpid.testlib import testrunner, TestBase
@@ -82,3 +83,20 @@ class BrokerTests(TestBase):
msg = queue.get(timeout=5)
self.assert_(msg.content.body == body)
+ def test_invalid_channel(self):
+ other = self.connect()
+ channel = other.channel(200)
+ try:
+ channel.queue_declare(exclusive=True)
+ self.fail("Expected error on queue_declare for invalid channel")
+ except Closed, e:
+ self.assertConnectionException(504, e.args[0])
+
+ channel = self.client.channel(200)
+ channel.channel_open()
+ channel.channel_close()
+ try:
+ channel.queue_declare(exclusive=True)
+ self.fail("Expected error on queue_declare for closed channel")
+ except Closed, e:
+ self.assertConnectionException(504, e.args[0])