diff idavoll/test/test_gateway.py @ 191:48245777acea

Return proper HTTP status codes on failed un-/subscription.
author Ralph Meijer <ralphm@ik.nu>
date Sat, 17 May 2008 18:31:31 +0000
parents 69cdd8c6a431
children e404775b12df
line wrap: on
line diff
--- a/idavoll/test/test_gateway.py	Sat May 17 18:30:39 2008 +0000
+++ b/idavoll/test/test_gateway.py	Sat May 17 18:31:31 2008 +0000
@@ -24,9 +24,8 @@
 entry.addElement("author").addElement("name", content="John Doe")
 entry.addElement("content", content="Some text.")
 
-#baseURI = "http://pubsub-test.ik.nu/"
 baseURI = "http://localhost:8086/"
-componentJID = "test.ik.nu"
+componentJID = "pubsub.localhost"
 
 class GatewayTest(unittest.TestCase):
     timeout = 2
@@ -191,7 +190,7 @@
 
     def test_subscribeNonExisting(self):
         def cb(err):
-            self.assertEqual('404', err.status)
+            self.assertEqual('403', err.status)
 
         d = self.client.subscribe('xmpp:%s?node=test' % componentJID)
         self.assertFailure(d, error.Error)
@@ -199,6 +198,16 @@
         return d
 
 
+    def test_unsubscribeNonExisting(self):
+        def cb(err):
+            self.assertEqual('403', err.status)
+
+        d = self.client.unsubscribe('xmpp:%s?node=test' % componentJID)
+        self.assertFailure(d, error.Error)
+        d.addCallback(cb)
+        return d
+
+
     def test_items(self):
         def cb(response):
             xmppURI = response['uri']