Fix unit tests when hg is uninstalled or matches a different Python.

Review Request #10621 — Created July 8, 2019 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x
5bdbfcb...

Reviewers

We had a unit test that was checking for the mercurial module to be
loaded before attempting to create a Mercurial-based repository. This
check wasn't correct, because we don't care if the module is accessible.
We only care if the hg binary is.

Another unit test wasn't performing a check at all, erroring out instead
when trying to create the repository.

This change fixes both issues by checking for the hg binary to be
available before running the test.

Unit tests pass with and without the hg binary (and without access to
the mercurial module).