'Test the ability to download an asset.'

def test_download(self):

    cassette_name = self.cassette_name('download')
    with self.recorder.use_cassette(cassette_name, preserve_exact_body_bytes=True, **self.betamax_simple_body):
        repository = self.gh.repository('sigmavirus24', 'github3.py')
        release = repository.release(76677)
        asset = next(release.assets())
        (fd, filename) = tempfile.mkstemp()
        os.close(fd)
        asset.download(filename)
    with open(filename, 'rb') as fd:
        assert (len(fd.read(1024)) > 0)
    os.unlink(filename)
