def __init__(self): ReceiveFileTest.__init__(self) SendFileTest.__init__(self) self._actions = [ self.connect, self.announce_contact, self.wait_for_contact, self.connect_to_salut, # receive file self.setup_http_server, self.send_ft_offer_iq, self.check_new_channel, self.create_ft_channel, self.set_uri, self.accept_file, self.receive_file, self.close_channel, # now send a file. We'll reuse the same XMPP connection self.request_ft_channel, self.create_ft_channel, self.got_send_iq, self.provide_file, self.client_request_file, self.send_file, self.close_channel ]
def __init__ (self): ReceiveFileTest.__init__ (self, bytestream.BytestreamIBBMsg, File (), cs.SOCKET_ADDRESS_TYPE_UNIX, cs.SOCKET_ACCESS_CONTROL_LOCALHOST, "")
def __init__(self, bytestream_cls, file, address_type, access_control, access_control_param): ReceiveFileTest.__init__(self, bytestream_cls, file, address_type, access_control, access_control_param) self._actions = [ self.connect, self.announce_contact, self.send_ft_offer_iq, self.check_new_channel, self.create_ft_channel, self.accept_file, self.receive_file, self.close_channel, self.done ]
def accept_file(self): ReceiveFileTest.accept_file(self) presence = domish.Element(('jabber:client', 'presence')) presence['from'] = self.contact_full_jid presence['to'] = 'test@localhost/Resource' presence['type'] = 'unavailable' self.stream.send(presence) e = self.q.expect('dbus-signal', signal='FileTransferStateChanged') state, reason = e.args assert state == cs.FT_STATE_CANCELLED assert reason == cs.FT_STATE_CHANGE_REASON_REMOTE_STOPPED return True
def __init__(self): ReceiveFileTest.__init__(self) SendFileTest.__init__(self) self._actions = [self.connect, self.announce_contact,self.wait_for_contact, self.connect_to_salut, # receive file self.setup_http_server, self.send_ft_offer_iq, self.check_new_channel, self.create_ft_channel, self.set_uri, self.accept_file, self.receive_file, self.close_channel, # now send a file. We'll reuse the same XMPP connection self.request_ft_channel, self.create_ft_channel, self.got_send_iq, self.provide_file, self.client_request_file, self.send_file, self.close_channel]
def accept_file(self): # URI is not set assertNoURI(self.ft_channel) ReceiveFileTest.accept_file(self)
def __init__(self, bytestream_cls, file, address_type, access_control, access_control_param): ReceiveFileTest.__init__(self, bytestream_cls, file, address_type, access_control, access_control_param) self._actions = [self.connect, self.announce_contact, self.send_ft_offer_iq, self.check_new_channel, self.create_ft_channel, self.accept_file, self.receive_file, self.close_channel, self.done]
def __init__(self): ReceiveFileTest.__init__(self, cs.SOCKET_ADDRESS_TYPE_IPV4)
def accept_file(self): ReceiveFileTest.accept_file(self) # The sender of the file disconnects self.outbound.transport.loseConnection() self.contact_service.stop()
def accept_file(self): # sender cancels FT immediately so stop to listen to the HTTP socket # before we accept the transfer. self.httpd.server_close() ReceiveFileTest.accept_file(self)
from saluttest import exec_test from file_transfer_helper import ReceiveFileTest if __name__ == '__main__': test = ReceiveFileTest() exec_test(test.test)
def close_channel(self): # Still no URI assertNoURI(self.ft_channel) ReceiveFileTest.close_channel(self)
def accept_file(self): # The XMPP connection is broken self.outbound.transport.loseConnection() ReceiveFileTest.accept_file(self)
def __init__(self): ReceiveFileTest.__init__(self, bytestream.BytestreamIBBMsg, File(), cs.SOCKET_ADDRESS_TYPE_UNIX, cs.SOCKET_ACCESS_CONTROL_LOCALHOST, "")