fixed int bug in netcontroller and test
parent
26c1983a61
commit
b1c0567c98
|
@ -30,8 +30,9 @@ class NetController:
|
|||
self.myID = ''
|
||||
if os.path.exists(self.torConfigLocation):
|
||||
torrc = open(self.torConfigLocation, 'r')
|
||||
if not self.hsPort in torrc.read():
|
||||
if not str(self.hsPort) in torrc.read():
|
||||
os.remove(self.torConfigLocation)
|
||||
torrc.close()
|
||||
return
|
||||
def generateTorrc(self):
|
||||
if os.path.exists(self.torConfigLocation):
|
||||
|
|
|
@ -82,12 +82,14 @@ class OnionrTests(unittest.TestCase):
|
|||
def testPGPGen(self):
|
||||
print('--------------------------')
|
||||
print('Testing PGP key generation')
|
||||
torID = open('data/hs/hostname').read()
|
||||
if os.path.exists('data/pgp/'):
|
||||
self.assertTrue(True)
|
||||
else:
|
||||
import core
|
||||
import core, netcontroller
|
||||
myCore = core.Core()
|
||||
net = netcontroller.NetController(1337)
|
||||
net.startTor()
|
||||
torID = open('data/hs/hostname').read()
|
||||
myCore.generateMainPGP(torID)
|
||||
if os.path.exists('data/pgp/'):
|
||||
self.assertTrue(True)
|
||||
|
|
Loading…
Reference in New Issue