Commit 40244ea6 authored by Nicolas Wavrant's avatar Nicolas Wavrant

slaprunner: test on update Account now checks .htpasswd

parent f1249e1d
...@@ -17,6 +17,7 @@ from slapos.runner.utils import (getProfilePath, getSession, isInstanceRunning, ...@@ -17,6 +17,7 @@ from slapos.runner.utils import (getProfilePath, getSession, isInstanceRunning,
from slapos.runner.process import killRunningProcess, isRunning from slapos.runner.process import killRunningProcess, isRunning
from slapos.runner import views from slapos.runner import views
import slapos.slap import slapos.slap
from slapos.htpasswd import HtpasswdFile
#Helpers #Helpers
...@@ -210,15 +211,15 @@ class SlaprunnerTestCase(unittest.TestCase): ...@@ -210,15 +211,15 @@ class SlaprunnerTestCase(unittest.TestCase):
def test_updateAccount(self): def test_updateAccount(self):
"""test Update accound, this needs the user to log in""" """test Update accound, this needs the user to log in"""
self.setAccount() self.setAccount()
htpasswd = os.path.join(self.app.config['etc_dir'], '.htpasswd')
import pdb;pdb.set_trace()
assert self.users[0] in open(htpasswd).read()
response = loadJson(self.updateAccount(self.updateUser, self.rcode)) response = loadJson(self.updateAccount(self.updateUser, self.rcode))
self.assertEqual(response['code'], 1) self.assertEqual(response['code'], 1)
#result = self.logout() import pdb;pdb.set_trace()
#assert "<h2>Login to Slapos Web Runner</h2>" in result.data encode = HtpasswdFile(htpasswd, False)
#retry login with new values encode.update(self.updateUser[0], self.updateUser[1])
#response = loadJson(self.login(self.updateUser[0], self.updateUser[1])) assert self.updateUser[0] in open(htpasswd).read()
#self.assertEqual(response['result'], "")
#log out now!
#self.logout()
def test_startProxy(self): def test_startProxy(self):
"""Test slapproxy""" """Test slapproxy"""
......
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