summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-04 12:27:02 +0000
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-07 10:43:05 +0000
commit796de2a1e75a683e77876002b7fca3636b9e8b63 (patch)
tree4449ff369c9e257a66da4af65a06383e43654b7c
parentbeefba0328a8d2dbcbf0ccb0f94899616360bd49 (diff)
test-fallback-socks5-proxy.py: factor out send_file_to_alice
-rw-r--r--tests/twisted/test-fallback-socks5-proxy.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/twisted/test-fallback-socks5-proxy.py b/tests/twisted/test-fallback-socks5-proxy.py
index c73412ad1..1c03e5606 100644
--- a/tests/twisted/test-fallback-socks5-proxy.py
+++ b/tests/twisted/test-fallback-socks5-proxy.py
@@ -151,11 +151,7 @@ def accept_stream_tube(q, bus, conn, stream):
check_proxies([('fallback2-proxy.localhost', '127.0.0.1', '6789'),
('fallback1-proxy.localhost', '127.0.0.1', '12345')], proxies)
-def send_file(q, bus, conn, stream):
- connect_and_announce_alice(q, bus, conn, stream)
-
- # Send a file; proxy queries are send when creating the FT channel
-
+def send_file_to_alice(q, conn):
call_async(q, conn.Requests, 'CreateChannel', {
cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_FILE_TRANSFER,
cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
@@ -164,6 +160,12 @@ def send_file(q, bus, conn, stream):
cs.FT_CONTENT_TYPE: 'text/plain',
cs.FT_SIZE: 10})
+def send_file(q, bus, conn, stream):
+ connect_and_announce_alice(q, bus, conn, stream)
+
+ # Send a file; proxy queries are send when creating the FT channel
+ send_file_to_alice(q, conn)
+
return_event, e1, e2 = q.expect_many(
EventPattern('dbus-return', method='CreateChannel'),
proxy_query_events[0], proxy_query_events[1])
@@ -181,13 +183,7 @@ def double_server(q, bus, conn, stream):
# set them twice in the SOCKS5 init stanza
connect_and_announce_alice(q, bus, conn, stream)
- call_async(q, conn.Requests, 'CreateChannel', {
- cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_FILE_TRANSFER,
- cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
- cs.TARGET_ID: 'alice@localhost',
- cs.FT_FILENAME: 'test.txt',
- cs.FT_CONTENT_TYPE: 'text/plain',
- cs.FT_SIZE: 10})
+ send_file_to_alice(q, conn)
return_event, e1, e2 = q.expect_many(
EventPattern('dbus-return', method='CreateChannel'),