From 50f7d3a976c3867a17bc3da9e9873fa179b43f82 Mon Sep 17 00:00:00 2001 From: Zara Gebru Date: Tue, 24 May 2016 16:10:40 +0200 Subject: Issue #287: add tests for binary key and refactor --- src/leap/keymanager/tests/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/leap/keymanager/tests/__init__.py') diff --git a/src/leap/keymanager/tests/__init__.py b/src/leap/keymanager/tests/__init__.py index 20d05e8..2a6a3f1 100644 --- a/src/leap/keymanager/tests/__init__.py +++ b/src/leap/keymanager/tests/__init__.py @@ -29,6 +29,7 @@ from leap.soledad.client import Soledad from leap.keymanager import KeyManager from leap.keymanager.openpgp import OpenPGPKey +PATH = os.path.dirname(os.path.realpath(__file__)) ADDRESS = 'leap@leap.se' ADDRESS_2 = 'anotheruser@leap.se' @@ -95,6 +96,14 @@ class KeyManagerWithSoledadTestCase(unittest.TestCase, BaseLeapTest): else: return "/usr/bin/gpg" + def get_public_binary_key(self): + with open(PATH + '/fixtures/public_key.bin', 'r') as binary_public_key: + return binary_public_key.read() + + def get_private_binary_key(self): + with open(PATH + '/fixtures/private_key.bin', 'r') as binary_private_key: + return binary_private_key.read() + # key 24D18DDF: public key "Leap Test Key " KEY_FINGERPRINT = "E36E738D69173C13D709E44F2F455E2824D18DDF" -- cgit v1.2.3