Work around different versions of patch in unit tests

Review Request #10208 — Created Oct. 9, 2018 and submitted — Latest diff uploaded

Information

Review Board
release-3.0.x
48a0ed7...

Reviewers

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.

Ran unit tests.