Changes to make the tests run on Mac

Hello people,

  I had to made the following changes to be able to run the tests on Mac, basically the changes are below

- The check for the leap_tests folder cannot use the whole path (because tempfile.mkdtemp uses different paths on different systems)
- The gpg binary is not guaranteed to be on /usr/bin/gpg and the PATH is trimmed on the tests init, so we have to detect gpg for the tests to run

The tests run fine now on Mac and Linux here
hmm the fallback sounds good to me.
I'm not sure how this exception will be shown in the test suite compared to passing a non-existent path, but it probably won't make a big difference. and the one testing it should be aware that gpg is needed, in any case.