Skip to content
Snippets Groups Projects
Commit 23b9f891 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #8888: Changed TaskSpecification parameters from ({"OtdbID":x}) to (OtdbID=x)

parent 346f2695
No related branches found
No related tags found
No related merge requests found
...@@ -56,58 +56,58 @@ if __name__ == "__main__": ...@@ -56,58 +56,58 @@ if __name__ == "__main__":
with RPC("StatusUpdateCmd", ForwardExceptions=True, busname=busname, timeout=5) as status_update_command: with RPC("StatusUpdateCmd", ForwardExceptions=True, busname=busname, timeout=5) as status_update_command:
# PIC # PIC
(data, status) = status_update_command({'OtdbID':1099269, 'NewStatus':'finished', 'UpdateTimestamps':True}) (data, status) = status_update_command(OtdbID=1099269, NewStatus='finished', UpdateTimestamps=True})
print status, data print status, data
# Template # Template
(data, status) = status_update_command({'OtdbID':1099238, 'NewStatus':'finished', 'UpdateTimestamps':True}) (data, status) = status_update_command(OtdbID=1099238, NewStatus='finished', UpdateTimestamps-True})
print status, data print status, data
# VIC # VIC
(data, status) = status_update_command({'OtdbID':1099266, 'NewStatus':'finished', 'UpdateTimestamps':True}) (data, status) = status_update_command(OtdbID=1099266, NewStatus='finished', UpdateTimestamps=True})
print status, data print status, data
# Nonexisting tree # Nonexisting tree
try: try:
(data, status) = status_update_command({'OtdbID':10, 'NewStatus':'finished', 'UpdateTimestamps':True}) (data, status) = status_update_command(OtdbID=10, NewStatus='finished', UpdateTimestamps=True})
except RPCException as e: except RPCException as e:
print "Caught expected exception on invalid treeID in status update" print "Caught expected exception on invalid treeID in status update"
# VIC tree: invalid status # VIC tree: invalid status
try: try:
(data, status) = status_update_command({'OtdbID':1099266, 'NewStatus':'what_happend', 'UpdateTimestamps':True}) (data, status) = status_update_command(OtdbID=1099266, NewStatus='what_happend', UpdateTimestamps=True})
except RPCException as e: except RPCException as e:
print "Caught expected exception on invalid status in status update" print "Caught expected exception on invalid status in status update"
with RPC("KeyUpdateCmd", ForwardExceptions=True, busname=busname, timeout=5) as key_update: with RPC("KeyUpdateCmd", ForwardExceptions=True, busname=busname, timeout=5) as key_update:
# VIC tree: valid # VIC tree: valid
(data, status) = key_update({'OtdbID':1099266, (data, status) = key_update(OtdbID:1099266,
'Updates':{'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.pythonHost':'NameOfTestHost'}}) Updates={'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.pythonHost':'NameOfTestHost'})
print status, data print status, data
# Template tree: not supported yet # Template tree: not supported yet
try: try:
(data, status) = key_update({'OtdbID':1099238, (data, status) = key_update(OtdbID=1099238,
'Updates':{'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.pythonHost':'NameOfTestHost'}}) Updates={'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.pythonHost':'NameOfTestHost'})
except RPCException as e: except RPCException as e:
print "Caught expected exception on invalid treetype in key update" print "Caught expected exception on invalid treetype in key update"
# PIC tree: not supported yet # PIC tree: not supported yet
try: try:
(data, status) = key_update({'OtdbID':1099269, 'Updates':{'LOFAR.PIC.Core.CS001.status_state':'50'}}) (data, status) = key_update(OtdbID=1099269, Updates={'LOFAR.PIC.Core.CS001.status_state':'50'})
except RPCException as e: except RPCException as e:
print "Caught expected exception on invalid treetype (PIC) in key update" print "Caught expected exception on invalid treetype (PIC) in key update"
# Non exsisting tree # Non exsisting tree
try: try:
(data, status) = key_update({'OtdbID':10, (data, status) = key_update(OtdbID=10,
'Updates':{'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.pythonHost':'NameOfTestHost'}}) Updates={'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.pythonHost':'NameOfTestHost'})
except RPCException as e: except RPCException as e:
print "Caught expected exception on invalid treeID in key update" print "Caught expected exception on invalid treeID in key update"
# VIC tree: wrong key # VIC tree: wrong key
try: try:
(data, status) = key_update({'OtdbID':1099266, (data, status) = key_update({OtdbID=1099266,
'Updates':{'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.NoSuchKey':'NameOfTestHost'}}) Updates={'LOFAR.ObsSW.Observation.ObservationControl.PythonControl.NoSuchKey':'NameOfTestHost'})
except RPCException as e: except RPCException as e:
print "Caught expected exception on invalid key in key update" print "Caught expected exception on invalid key in key update"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment