Using copyrighted materials in test code is fair use and a well established practice:
https://en.wikipedia.org/wiki/Lenna
The creators of youtube-dl are not distributing the material or inducing infringement by using a link to it in a unit test. I am typically on the RIAA's side,
https://news.ycombinator.com/item?id=23079092
but they're going to lose this one. If RIAA should be mad at anyone, it is youtube for distributing it without DRM. Youtube really really REALLY should have had their asses taken to the cleaners in viacom vs youtube. I don't know what the settlement was, but it wasn't enough, because youtube still exists.
https://en.wikipedia.org/wiki/Viacom_International_Inc._v._Y....
This is a python program doing exactly the same steps a browser takes to download the file. It's just written in python instead of js.