Commit 3ba9ab87 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: testSlapOSERP5InteractionWorkflow: there is no source administrator on Compute Node

parent c09b4306
......@@ -23,16 +23,13 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
SlapOSTestCaseMixin):
def _test_ComputeNode_setAllocationScope_public(self,
allocation_scope="open/public",
source_administration=None):
def test_ComputeNode_setAllocationScope_open(self):
compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node')
compute_node.edit(capacity_scope=None,
monitor_scope=None,
source_administration=source_administration)
monitor_scope=None)
self.commit()
compute_node.edit(allocation_scope=allocation_scope)
compute_node.edit(allocation_scope="open")
self.commit()
self.assertEqual(compute_node.getCapacityScope(), 'close')
......@@ -52,50 +49,12 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
return compute_node
def test_ComputeNode_setAllocationScope_public_no_source_adm(self):
self._test_ComputeNode_setAllocationScope_public()
def test_ComputeNode_setAllocationScope_subscription_no_source_adm(self):
self._test_ComputeNode_setAllocationScope_public(
allocation_scope="open/subscription"
)
def test_ComputeNode_setAllocationScope_personal(self,
source_administration=None):
compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node',
capacity_scope=None,
monitor_scope=None,
source_administration=source_administration)
self.commit()
compute_node.edit(allocation_scope='open/personal')
self.commit()
self.assertEqual(compute_node.getCapacityScope(), 'close')
self.assertEqual(compute_node.getMonitorScope(), 'enabled')
self.commit()
compute_node.edit(allocation_scope=None)
self.commit()
compute_node.edit(capacity_scope="open")
self.commit()
compute_node.edit(allocation_scope='open/personal')
self.commit()
self.assertEqual(compute_node.getCapacityScope(), 'close')
self.assertEqual(compute_node.getMonitorScope(), 'enabled')
return compute_node
def _test_ComputeNode_setAllocationScope_closed(self,
source_administration=None,
allocation_scope="close/forever",
monitor_scope='enabled'):
compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node',
capacity_scope=None,
monitor_scope=None,
source_administration=source_administration)
allocation_scope="close/forever"):
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
capacity_scope=None,
monitor_scope=None)
self.commit()
compute_node.edit(allocation_scope=allocation_scope)
......@@ -119,7 +78,7 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
def test_ComputeNode_setAllocationScope_closed_forever(self):
self._test_ComputeNode_setAllocationScope_closed(monitor_scope='disabled')
self._test_ComputeNode_setAllocationScope_closed()
def test_ComputeNode_setAllocationScope_closed_termination(self):
self._test_ComputeNode_setAllocationScope_closed(
......@@ -139,4 +98,4 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
def test_ComputeNode_setAllocationScope_closed_noallocation(self):
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/noallocation",
)
\ No newline at end of file
)
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