Commit 4339381f authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5:

* testSlapOSERP5InteractionWorkflow: there is no source administrator on Compute Node
* drop Base_useSaleTradeConditionReference
parent 8828a17b
......@@ -7,7 +7,8 @@
</role>
<role id='Auditor'>
<property id='title'>Subscription Customer</property>
<property id='condition'>python: here.Base_useSaleTradeConditionReference(('slapos_subscription_trade_condition', 'slapos_aggregated_trade_condition', 'slapos_aggregated_subscription_trade_condition'))</property>
<property id='description'>python: here.Base_useSaleTradeConditionReference(('slapos_subscription_trade_condition', 'slapos_aggregated_trade_condition', 'slapos_aggregated_subscription_trade_condition'))</property>
<property id='condition'>python: False</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='categories'>local_role_group/user</multi_property>
<multi_property id='base_category'>destination_decision</multi_property>
......
......@@ -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