'Testing whether an anon download does not make progress without relay nodes'

@deferred(timeout=60)
@inlineCallbacks
def test_anon_download_no_relays(self):

    (yield self.setup_nodes(num_relays=0, num_exitnodes=1))
    def download_state_callback(ds):
        download = ds.get_download()
        if (download.get_progress() != 0.0):
            self.test_deferred.errback(RuntimeError('Anonymous    download    should    not    make    progress    without    relay    nodes'))
            return (0.0, False)
        return (2.0, False)
    download = self.start_anon_download(hops=2)
    download.set_state_callback(download_state_callback)
    reactor.callLater(30, self.test_deferred.callback, None)
    (yield self.test_deferred)
