'Testing whether we can start a download from a file'

@deferred(timeout=10)
def test_start_download_from_file(self):

    def verify_download(_):
        self.assertGreaterEqual(len(self.session.get_downloads()), 1)
    post_data = {'uri': ('file:%s' % os.path.join(TESTS_DATA_DIR, 'video.avi.torrent'))}
    expected_json = {'started': True, 'infohash': '42bb0a78d8a10bef4a5aee3a7d9f1edf9941cee4'}
    return self.do_request('downloads', expected_code=200, request_type='PUT', post_data=post_data, expected_json=expected_json).addCallback(verify_download)
