'Testing whether an error is returned when we toggle a file for inclusion out of range'

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

    (video_tdef, _) = self.create_local_torrent(os.path.join(TESTS_DATA_DIR, 'video.avi'))
    self.session.start_download_from_tdef(video_tdef, DownloadStartupConfig())
    infohash = video_tdef.get_infohash().encode('hex')
    self.should_check_equality = False
    return self.do_request(('downloads/%s' % infohash), expected_code=400, post_data={'selected_files[]': 1234}, request_type='PATCH')
