Commit 07849d75 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: project in test

parent 450019fe
......@@ -47,8 +47,9 @@ class TestSlapOSCloudSlapOSCacheMixin(
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
self.pinDateTime(DateTime())
self._makeComputeNode()
self._makeComplexComputeNode(with_slave=True)
project = self.addProject()
self._makeComputeNode(project)
self._makeComplexComputeNode(project, with_slave=True)
self.tic()
def beforeTearDown(self):
......@@ -368,7 +369,8 @@ class TestSlapOSCloudSoftwareInstance(
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
self._makeTree()
self.project = self.addProject()
self._makeTree(self.project)
def test_getXmlAsDict(self):
simple_parameter_sample_xml = """<?xml version='1.0' encoding='utf-8'?>
......@@ -431,8 +433,8 @@ class TestSlapOSCloudSoftwareInstance(
self.software_instance._asParameterDict)
def test_asParameterDict(self):
self._makeComputeNode()
self._makeComplexComputeNode(with_slave=True)
self._makeComputeNode(self.project)
self._makeComplexComputeNode(self.project, with_slave=True)
as_parameter_dict = self.start_requested_software_instance._asParameterDict()
......@@ -477,8 +479,8 @@ class TestSlapOSCloudSoftwareInstance(
self.assertEqual(as_parameter_dict["full_ip_list"], [])
def test_getInstanceTreeIpList(self):
self._makeComputeNode()
self._makeComplexComputeNode(with_slave=True)
self._makeComputeNode(self.project)
self._makeComplexComputeNode(self.project, with_slave=True)
self.tic()
self.assertEqual([(u'', u'ip_address_1')],
......@@ -489,18 +491,16 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
self.project = self.addProject()
# Prepare compute_node
self.compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
self.compute_node.edit(
title="Compute Node %s" % self.new_id,
reference="TESTCOMP-%s" % self.new_id
reference="TESTCOMP-%s" % self.new_id,
follow_up_value=self.project
)
if getattr(self, "person", None) is not None:
self.compute_node.edit(
source_administration_value=getattr(self, "person", None),
)
self.compute_node.validate()
self._addCertificateLogin(self.compute_node)
......@@ -521,7 +521,7 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
# TestSlapOSSlapToolgetFullComputerInformation.test_activate_getFullComputerInformation_first_access
#
self._makeComplexComputeNode(with_slave=True)
self._makeComplexComputeNode(self.project, with_slave=True)
self.portal.REQUEST['disable_isTestRun'] = True
self.login(self.compute_node_user_id)
......
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