The RIAA would of course argue that examples of infringement in the test cases or readme demonstrate intent. A reasonable response to that might (or might not, depending on the context) be that infringement in those specific cases was never intentional but instead purely by accident.
If the infringement in this case ends up appearing to be intentional, it would probably make for a very uphill battle to argue that the tool itself was only intended for legitimate use cases.
Edit: Of course, it's reasonable to ask - if it's legal for YouTube to distribute the content, does using youtube-dl suddenly make it illegal? Is it a violation of copyright to record a pay per view stream? What about a publicly available stream paid for by ad revenue?
Well that's the question, isn't it? Is downloading those particular URLs infringement if the content is legally allowed to be hosted on YouTube in the first place? If so, was the use of those URLs specifically intended to demonstrate or verify the ability of the tool to infringe copyright? Alternatively, can the tool be said to circumvent a protection device under DMCA section 1201?
(For the record, my answer to all of the above is an emphatic "no".)
Instead of a unit test which successfully downloads a copyright-protected video, it would have a unit test which attempts to download such videos but returns an error message to the user based on a hardcoded blacklist of videos IDs, stored in a separate config file. (It would also have a unit test for successfully downloading a public domain video from the developers' own channel, of course).
The developers could also make clear that they are happy to receive DMCA requests to add specific video IDs to their blacklist. As for what happens if the user deletes the blacklist config file, maybe that won't have a unit test.
If such a fork was successful in fending off court cases, though, it would start to raise interesting First Amendment questions. The difference between the two pieces of software, in practice, is just the text in the README telling people not to break the law (plus a single "Delete" button press after installation, which the user would have to learn about from another source). This would mean that the difference between developers complying with the law and breaking the law is including that text in the README, which effectively seems like compelled speech.
Probably not. If intent were to be demonstrated in court, a derivative work would almost certainly be tainted in turn unless those authors had a _really_ good justification for their actions. (IANAL though; I'm just guessing based on other copyright cases that came up in the media before.)
For example, imagine forking Napster back in the day, redoing the UI, and rewriting half of the internals. Do you really think a court would let that fly? Judges are hardly idiots.
That being said, why not just mirror the original to a host running as a tor hidden service and continue all development efforts there?