try and fix tests

This commit is contained in:
Miguel Jacq 2017-12-07 15:33:12 +11:00
parent d69e93a5ba
commit 796a4b3b5d
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
3 changed files with 6 additions and 3 deletions

View File

@ -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):
"""

View File

@ -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

View File

@ -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