Commit 1b4653ad authored by Xavier Thompson's avatar Xavier Thompson

software/jupyter: Unserialize connection parameters

parent 1fcf1800
......@@ -19,7 +19,7 @@ md5sum = de37ec3d4adb0be4c67bcc7397f27c91
[instance-jupyter]
filename = instance-jupyter.cfg.in
md5sum = 38bbb350a07ad2bb9f01b46122231708
md5sum = cbc90e517ae3680ab8bef04c6f503af5
[jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja
......
......@@ -175,7 +175,7 @@ instance-configuration =
raw jupyter-password ${jupyter-password:passwd}
[publish-connection-parameter]
recipe = slapos.cookbook:publish.serialised
recipe = slapos.cookbook:publish
jupyter-classic-url = ${request-slave-frontend:connection-secure_access}/tree
url = ${:jupyter-classic-url}
jupyterlab-url = ${request-slave-frontend:connection-secure_access}/lab
......
......@@ -43,12 +43,7 @@ setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass(
class TestJupyter(InstanceTestCase):
def test(self):
parameter_dict = self.computer_partition.getConnectionParameterDict()
self.assertTrue('_' in parameter_dict)
try:
connection_dict = json.loads(parameter_dict['_'])
except Exception as e:
self.fail("Can't parse json in %s, error %s" % (parameter_dict['_'], e))
connection_dict = self.computer_partition.getConnectionParameterDict()
self.assertTrue('password' in connection_dict)
password = connection_dict['password']
......@@ -92,15 +87,11 @@ class TestJupyterAdditional(InstanceTestCase):
@classmethod
def getInstanceParameterDict(cls):
return {
'frontend-additional-instance-guid': 'SOMETHING' }
'frontend-additional-instance-guid': 'SOMETHING'
}
def test(self):
parameter_dict = self.computer_partition.getConnectionParameterDict()
self.assertTrue('_' in parameter_dict)
try:
connection_dict = json.loads(parameter_dict['_'])
except Exception as e:
self.fail("Can't parse json in %s, error %s" % (parameter_dict['_'], e))
connection_dict = self.computer_partition.getConnectionParameterDict()
result = requests.get(
connection_dict['url'], verify=False, allow_redirects=False)
......@@ -151,12 +142,7 @@ class TestJupyterAdditional(InstanceTestCase):
class TestJupyterPassword(InstanceTestCase):
def test(self):
parameter_dict = self.computer_partition.getConnectionParameterDict()
self.assertTrue('_' in parameter_dict)
try:
connection_dict = json.loads(parameter_dict['_'])
except Exception as e:
self.fail("Can't parse json in %s, error %s" % (parameter_dict['_'], e))
connection_dict = self.computer_partition.getConnectionParameterDict()
url = connection_dict['url']
with requests.Session() as s:
......
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