fixed int bug in netcontroller and test

This commit is contained in:
Kevin Froman 2018-01-20 12:06:25 -06:00
parent 26c1983a61
commit b1c0567c98
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
2 changed files with 6 additions and 3 deletions

View File

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

View File

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