Commit 810f0e94 authored by Łukasz Nowak's avatar Łukasz Nowak

Check that data are correctly stored.

parent 39f40076
...@@ -8,7 +8,6 @@ import urlparse ...@@ -8,7 +8,6 @@ import urlparse
import json import json
import tempfile import tempfile
import os import os
import xml_marshaller
class Simulator: class Simulator:
def __init__(self, outfile): def __init__(self, outfile):
...@@ -137,8 +136,6 @@ class VifibSlaposRestAPIV1Mixin(TestVifibSlapWebServiceMixin): ...@@ -137,8 +136,6 @@ class VifibSlaposRestAPIV1Mixin(TestVifibSlapWebServiceMixin):
('slave', 'shared'), ('slave', 'shared'),
('status', 'state') ('status', 'state')
): ):
if k_j in ('sla', 'parameter'):
reckwargs[k_i] = xml_marshaller.xml_marshaller.loads(reckwargs.pop(k_i))
kwargs[k_i] = kwargs.pop(k_j) kwargs[k_i] = kwargs.pop(k_j)
self.assertEqual(args, recargs) self.assertEqual(args, recargs)
self.assertEqual(kwargs, reckwargs) self.assertEqual(kwargs, reckwargs)
...@@ -279,6 +276,12 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin): ...@@ -279,6 +276,12 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(202) self.assertResponseCode(202)
self.assertResponseJson() self.assertResponseJson()
kwargs['parameter'] = '<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<i'\
'nstance>\n <parameter id="Custom1">one string</parameter>\n <paramet'\
'er id="Custom2">one float</parameter>\n <parameter id="Custom3">[u\'a'\
'bc\', u\'def\']</parameter>\n</instance>\n'
kwargs['sla'] = '<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<instanc'\
'e>\n <parameter id="computer_id">COMP-0</parameter>\n</instance>\n'
self.assertPersonRequestSimulator((), kwargs) self.assertPersonRequestSimulator((), kwargs)
self.assertEqual({ self.assertEqual({
"status": "processing", "status": "processing",
...@@ -308,6 +311,12 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin): ...@@ -308,6 +311,12 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(202) self.assertResponseCode(202)
self.assertResponseJson() self.assertResponseJson()
kw_request['parameter'] = '<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<i'\
'nstance>\n <parameter id="Custom1">one string</parameter>\n <paramet'\
'er id="Custom2">one float</parameter>\n <parameter id="Custom3">[u\'a'\
'bc\', u\'def\']</parameter>\n</instance>\n'
kw_request['sla'] = '<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<instanc'\
'e>\n <parameter id="computer_id">COMP-0</parameter>\n</instance>\n'
self.assertPersonRequestSimulator((), kw_request) self.assertPersonRequestSimulator((), kw_request)
self.assertEqual({ self.assertEqual({
"status": "processing", "status": "processing",
......
35 36
\ 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