From 90807727c80cb83a14ada335145ce70b79f1c312 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 7 Dec 2017 15:33:12 +1100 Subject: [PATCH] try and fix tests --- onionshare/onion.py | 4 ++-- onionshare/onionshare.py | 4 +++- test/test_onionshare.py | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/onionshare/onion.py b/onionshare/onion.py index b95d975d..218dafd5 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -414,13 +414,13 @@ class Onion(object): self.service_id = res.content()[0][2].split('=')[1] onion_host = self.service_id + '.onion' - private_key = res.private_key + self.private_key = res.private_key if self.stealth: auth_cookie = res.content()[2][2].split('=')[1].split(':')[1] self.auth_string = 'HidServAuth {} {}'.format(onion_host, auth_cookie) - return (onion_host, private_key) + return onion_host def cleanup(self): """ diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 128e71af..7466a163 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -76,7 +76,9 @@ class OnionShare(object): if self.shutdown_timeout > 0: self.shutdown_timer = common.close_after_seconds(self.shutdown_timeout) - self.onion_host, self.private_key = self.onion.start_onion_service(self.port) + self.onion_host = self.onion.start_onion_service(self.port) + + self.private_key = self.onion.private_key if self.stealth: self.auth_string = self.onion.auth_string diff --git a/test/test_onionshare.py b/test/test_onionshare.py index f3e35dfc..76e471bd 100644 --- a/test/test_onionshare.py +++ b/test/test_onionshare.py @@ -27,6 +27,7 @@ from onionshare import OnionShare class MyOnion: def __init__(self, stealth=False): self.auth_string = 'TestHidServAuth' + self.private_key = '' self.stealth = stealth @staticmethod