'Testing whether a correct Dispersy message is created when we add a torrent to our channel'

@blocking_call_on_reactor_thread
def test_create_torrent_from_def(self):

    metainfo = {'info': {'name': 'my_torrent', 'piece    length': 12345, 'pieces': '12345678901234567890', 'files': [{'path': ['test.txt'], 'length': 1234}]}}
    torrent = TorrentDef.load_from_dict(metainfo)
    self.channel_community.initialize()
    message = self.channel_community._disp_create_torrent_from_torrentdef(torrent, 12345)
    self.assertEqual(message.payload.name, 'my_torrent')
    self.assertEqual(len(message.payload.files), 1)
