[Telepathy-commits] [telepathy-salut/master] rename tubes-to-nonexistant-jids.py to tubes-to-nonexistant-ids.py
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Feb 6 03:15:06 PST 2009
---
tests/twisted/avahi/tubes-to-nonexistant-ids.py | 51 ++++++++++++++++++++++
tests/twisted/avahi/tubes-to-nonexistant-jids.py | 51 ----------------------
2 files changed, 51 insertions(+), 51 deletions(-)
create mode 100644 tests/twisted/avahi/tubes-to-nonexistant-ids.py
delete mode 100644 tests/twisted/avahi/tubes-to-nonexistant-jids.py
diff --git a/tests/twisted/avahi/tubes-to-nonexistant-ids.py b/tests/twisted/avahi/tubes-to-nonexistant-ids.py
new file mode 100644
index 0000000..4f4420c
--- /dev/null
+++ b/tests/twisted/avahi/tubes-to-nonexistant-ids.py
@@ -0,0 +1,51 @@
+"""
+Test that requests for Tubes and StreamTube channels to ids which aren't
+actually on the network fail gracefully with NotAvailable
+"""
+
+from saluttest import exec_test
+
+from constants import (
+ HT_CONTACT, CONN_IFACE_REQUESTS,
+ CHANNEL_TYPE, TARGET_HANDLE_TYPE, TARGET_HANDLE,
+ CHANNEL_TYPE_TUBES, CHANNEL_TYPE_STREAM_TUBE,
+ NOT_AVAILABLE
+ )
+
+import dbus
+
+arbitrary_ids = [ "DooN4Bei at TheeK6bo-Tegh4aci", "ahrui1iM at Dai6igho-ADetaes3" ]
+
+def test(q, bus, conn):
+ conn.Connect()
+ q.expect('dbus-signal', signal='StatusChanged', args=[0L, 0L])
+
+ h1, h2 = conn.RequestHandles(HT_CONTACT, arbitrary_ids)
+
+ try:
+ conn.RequestChannel(CHANNEL_TYPE_TUBES, HT_CONTACT, h1, True)
+ except dbus.DBusException, e:
+ assert e.get_dbus_name() == NOT_AVAILABLE, e.get_dbus_name()
+ else:
+ assert False
+
+ requestotron = dbus.Interface(conn, CONN_IFACE_REQUESTS)
+
+ try:
+ requestotron.CreateChannel({
+ CHANNEL_TYPE: CHANNEL_TYPE_STREAM_TUBE,
+ TARGET_HANDLE_TYPE: HT_CONTACT,
+ TARGET_HANDLE: h2,
+ CHANNEL_TYPE_STREAM_TUBE + ".Service": "com.example",
+ })
+ except dbus.DBusException, e:
+ print e
+ assert e.get_dbus_name() == NOT_AVAILABLE, e.get_dbus_name()
+ else:
+ assert False
+
+ conn.Disconnect()
+ q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
+
+if __name__ == '__main__':
+ exec_test(test)
diff --git a/tests/twisted/avahi/tubes-to-nonexistant-jids.py b/tests/twisted/avahi/tubes-to-nonexistant-jids.py
deleted file mode 100644
index 60c7ee4..0000000
--- a/tests/twisted/avahi/tubes-to-nonexistant-jids.py
+++ /dev/null
@@ -1,51 +0,0 @@
-"""
-Test that requests for Tubes and StreamTube channels to jids which aren't
-actually on the network fail gracefully with NotAvailable
-"""
-
-from saluttest import exec_test
-
-from constants import (
- HT_CONTACT, CONN_IFACE_REQUESTS,
- CHANNEL_TYPE, TARGET_HANDLE_TYPE, TARGET_HANDLE,
- CHANNEL_TYPE_TUBES, CHANNEL_TYPE_STREAM_TUBE,
- NOT_AVAILABLE
- )
-
-import dbus
-
-arbitrary_jids = [ "DooN4Bei at TheeK6bo-Tegh4aci", "ahrui1iM at Dai6igho-ADetaes3" ]
-
-def test(q, bus, conn):
- conn.Connect()
- q.expect('dbus-signal', signal='StatusChanged', args=[0L, 0L])
-
- h1, h2 = conn.RequestHandles(HT_CONTACT, arbitrary_jids)
-
- try:
- conn.RequestChannel(CHANNEL_TYPE_TUBES, HT_CONTACT, h1, True)
- except dbus.DBusException, e:
- assert e.get_dbus_name() == NOT_AVAILABLE, e.get_dbus_name()
- else:
- assert False
-
- requestotron = dbus.Interface(conn, CONN_IFACE_REQUESTS)
-
- try:
- requestotron.CreateChannel({
- CHANNEL_TYPE: CHANNEL_TYPE_STREAM_TUBE,
- TARGET_HANDLE_TYPE: HT_CONTACT,
- TARGET_HANDLE: h2,
- CHANNEL_TYPE_STREAM_TUBE + ".Service": "com.example",
- })
- except dbus.DBusException, e:
- print e
- assert e.get_dbus_name() == NOT_AVAILABLE, e.get_dbus_name()
- else:
- assert False
-
- conn.Disconnect()
- q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
-
-if __name__ == '__main__':
- exec_test(test)
--
1.5.6.5
More information about the telepathy-commits
mailing list