Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
23b9f891
Commit
23b9f891
authored
9 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/OTDB_Services/test/t_TreeService.py
+14
-14
14 additions, 14 deletions
SAS/OTDB_Services/test/t_TreeService.py
with
14 additions
and
14 deletions
SAS/OTDB_Services/test/t_TreeService.py
+
14
−
14
View file @
23b9f891
...
@@ -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
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment