From 607df76ebdf5516085835a0a1f7718baf966a6e0 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 20 Sep 2016 16:45:53 +0200 Subject: [feat] discover gpg bin path instead of hardcode it --- src/leap/bitmask/keymanager/testing/__init__.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/leap/bitmask/keymanager') diff --git a/src/leap/bitmask/keymanager/testing/__init__.py b/src/leap/bitmask/keymanager/testing/__init__.py index 7c918c99..3a78c516 100644 --- a/src/leap/bitmask/keymanager/testing/__init__.py +++ b/src/leap/bitmask/keymanager/testing/__init__.py @@ -1,10 +1,10 @@ -import distutils.spawn import os.path from twisted.internet.defer import gatherResults from twisted.trial import unittest from leap.common.testing.basetest import BaseLeapTest +from leap.bitmask.util import get_gpg_bin_path from leap.bitmask.keymanager import KeyManager from leap.soledad.client import Soledad @@ -241,7 +241,7 @@ THx7N776fcYHGumbqUMYrxrcZSbNveE6SaK8fphRam1dewM0 class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest): def setUp(self): - self.gpg_binary_path = self._find_gpg() + self.gpg_binary_path = get_gpg_bin_path() self._soledad = Soledad( u"leap@leap.se", @@ -290,13 +290,6 @@ class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest): gpgbinary=self.gpg_binary_path, ca_cert_path=ca_cert_path) - def _find_gpg(self): - gpg_path = distutils.spawn.find_executable('gpg') - if gpg_path is not None: - return os.path.realpath(gpg_path) - else: - return "/usr/bin/gpg" - def get_public_binary_key(self): with open(PATH + '/public_key.bin', 'r') as binary_public_key: return binary_public_key.read() -- cgit v1.2.3