Commit bdea823b authored by Jérome Perrin's avatar Jérome Perrin

software/erp5/test: make utility methods classmethod

so that we can use them in setUpClass
parent 2023e1bf
...@@ -49,17 +49,20 @@ def setUpModule(): ...@@ -49,17 +49,20 @@ def setUpModule():
class ERP5InstanceTestCase(SlapOSInstanceTestCase): class ERP5InstanceTestCase(SlapOSInstanceTestCase):
"""ERP5 base test case """ERP5 base test case
""" """
def getRootPartitionConnectionParameterDict(self): @classmethod
def getRootPartitionConnectionParameterDict(cls):
"""Return the output paramters from the root partition""" """Return the output paramters from the root partition"""
return json.loads( return json.loads(
self.computer_partition.getConnectionParameterDict()['_']) cls.computer_partition.getConnectionParameterDict()['_'])
def getComputerPartition(self, partition_reference): @classmethod
for computer_partition in self.slap.computer.getComputerPartitionList(): def getComputerPartition(cls, partition_reference):
for computer_partition in cls.slap.computer.getComputerPartitionList():
if partition_reference == computer_partition.getInstanceParameter( if partition_reference == computer_partition.getInstanceParameter(
'instance_title'): 'instance_title'):
return computer_partition return computer_partition
def getComputerPartitionPath(self, partition_reference): @classmethod
partition_id = self.getComputerPartition(partition_reference).getId() def getComputerPartitionPath(cls, partition_reference):
return os.path.join(self.slap._instance_root, partition_id) partition_id = cls.getComputerPartition(partition_reference).getId()
return os.path.join(cls.slap._instance_root, partition_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