Work around different versions of patch in unit tests
Work around different versions of patch in unit tests

Review request https://reviews.reviewboard.org/r/10164/ landed on
release-4.0.x, but the underlying issue was introduced on release-3.0.x.
This patch is a backport of that patch. The original commit message
follows:

We had a unit test that depended on the specific version of `patch`
installed. Newer versions of patch will accept a diff that contains no
hunks, whereas older versions will fail with a message saying that the
input contained only garbage.

We now have unit tests that check the correct behaviour happens in both
cases by replacing our call to `patch`.

Testing Done:
Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/10208/

chipx86/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,chipx86/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,chipx86/reviewboard