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