Commit b06a4f05 authored by Łukasz Nowak's avatar Łukasz Nowak

Factorise and simplify.

parent ebf27837
...@@ -17,7 +17,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin): ...@@ -17,7 +17,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin):
title=self.generateNewSoftwareTitle(), title=self.generateNewSoftwareTitle(),
reference="TESTHS-%s" % self.generateNewId(), reference="TESTHS-%s" % self.generateNewId(),
) )
kw = dict( self.request_kw = dict(
software_release=\ software_release=\
self.generateNewSoftwareReleaseUrl(), self.generateNewSoftwareReleaseUrl(),
software_type=self.generateNewSoftwareType(), software_type=self.generateNewSoftwareType(),
...@@ -27,8 +27,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin): ...@@ -27,8 +27,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin):
software_title=hosting_subscription.getTitle(), software_title=hosting_subscription.getTitle(),
state='started' state='started'
) )
hosting_subscription.requestStart(**kw) hosting_subscription.requestStart(**self.request_kw)
hosting_subscription.requestInstance(**kw) hosting_subscription.requestInstance(**self.request_kw)
self.instance = hosting_subscription.getPredecessorValue() self.instance = hosting_subscription.getPredecessorValue()
self.tic() self.tic()
...@@ -58,16 +58,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin): ...@@ -58,16 +58,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin):
def test_bang_tree(self): def test_bang_tree(self):
self.login(self.instance.getReference()) self.login(self.instance.getReference())
request_kw = dict( request_kw = self.request_kw.copy()
software_release=\ request_kw['software_title'] = 'New %s' % self.generateNewId()
self.generateNewSoftwareReleaseUrl(),
software_type=self.generateNewSoftwareType(),
instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(),
shared=False,
software_title='New %s' % self.generateNewId(),
state='started'
)
self.instance.requestInstance(**request_kw) self.instance.requestInstance(**request_kw)
request_instance = self.instance.REQUEST['request_instance'] request_instance = self.instance.REQUEST['request_instance']
self.instance.REQUEST['request_instance'] = None self.instance.REQUEST['request_instance'] = None
...@@ -134,16 +126,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin): ...@@ -134,16 +126,8 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(testSlapOSMixin):
new_name = 'New %s' % self.generateNewId() new_name = 'New %s' % self.generateNewId()
self.login(self.instance.getReference()) self.login(self.instance.getReference())
request_kw = dict( request_kw = self.request_kw.copy()
software_release=\ request_kw['software_title'] = new_name
self.generateNewSoftwareReleaseUrl(),
software_type=self.generateNewSoftwareType(),
instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(),
shared=False,
software_title=new_name,
state='started'
)
self.instance.requestInstance(**request_kw) self.instance.requestInstance(**request_kw)
request_instance = self.instance.REQUEST['request_instance'] request_instance = self.instance.REQUEST['request_instance']
......
171 172
\ No newline at end of file \ 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