Commit db3cd15a authored by Nicolas Wavrant's avatar Nicolas Wavrant

runner: tests do not use .rcode file anymore

parent 05fab134
...@@ -20,7 +20,8 @@ import shutil ...@@ -20,7 +20,8 @@ import shutil
import time import time
import unittest import unittest
from slapos.runner.utils import (getProfilePath, getSession, isInstanceRunning, from slapos.runner.utils import (getProfilePath, getRcode,
getSession, isInstanceRunning,
isSoftwareRunning, startProxy, isSoftwareRunning, startProxy,
isSoftwareReleaseReady, isSoftwareReleaseReady,
runSlapgridUntilSuccess, runSlapgridUntilSuccess,
...@@ -103,8 +104,9 @@ class SlaprunnerTestCase(unittest.TestCase): ...@@ -103,8 +104,9 @@ class SlaprunnerTestCase(unittest.TestCase):
self.app = views.app.test_client() self.app = views.app.test_client()
self.app.config = views.app.config self.app.config = views.app.config
#Create password recover code #Create password recover code
with open(os.path.join(views.app.config['etc_dir'], '.rcode'), 'w') as rpwd: parser = ConfigParser.ConfigParser()
rpwd.write(self.rcode) parser.read(self.app.config['knowledge0_cfg'])
parser.set('public', 'recovery-code', self.rcode)
#Create config.json #Create config.json
json_file = os.path.join(views.app.config['etc_dir'], 'config.json') json_file = os.path.join(views.app.config['etc_dir'], 'config.json')
if not os.path.exists(json_file): if not os.path.exists(json_file):
...@@ -118,7 +120,6 @@ class SlaprunnerTestCase(unittest.TestCase): ...@@ -118,7 +120,6 @@ class SlaprunnerTestCase(unittest.TestCase):
def tearDown(self): def tearDown(self):
"""Remove all test data""" """Remove all test data"""
os.unlink(os.path.join(self.app.config['etc_dir'], '.rcode'))
project = os.path.join(self.app.config['etc_dir'], '.project') project = os.path.join(self.app.config['etc_dir'], '.project')
users = os.path.join(self.app.config['etc_dir'], '.users') users = os.path.join(self.app.config['etc_dir'], '.users')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment