Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
fda45c50
Commit
fda45c50
authored
Nov 09, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test slaptool loadComputerConfigurationFromXML.
parent
4ce0c6d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
master/bt5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
...5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
+33
-0
master/bt5/slapos_slap_tool/bt/revision
master/bt5/slapos_slap_tool/bt/revision
+1
-1
No files found.
master/bt5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
View file @
fda45c50
...
...
@@ -506,6 +506,39 @@ class TestSlapOSSlapToolComputerAccess(TestSlapOSSlapToolMixin):
if
os
.
path
.
exists
(
self
.
computer_bang_simulator
):
os
.
unlink
(
self
.
computer_bang_simulator
)
def
assertLoadComputerConfigurationFromXML
(
self
,
args
,
kwargs
):
stored
=
eval
(
open
(
self
.
computer_load_configuration_simulator
).
read
())
# do the same translation magic as in workflow
self
.
assertEqual
(
stored
,
[{
'recargs'
:
args
,
'reckwargs'
:
kwargs
,
'recmethod'
:
'Computer_updateFromDict'
}])
def
test_loadComputerConfigurationFromXML
(
self
):
self
.
computer_load_configuration_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
self
.
login
(
self
.
computer_id
)
self
.
computer
.
Computer_updateFromDict
=
Simulator
(
self
.
computer_load_configuration_simulator
,
'Computer_updateFromDict'
)
computer_xml
=
"""
\
<?xml version='1.0' encoding='UTF-8'?>
<marshal>
<dictionary id='i2'>
<string>reference</string>
<string>%(computer_reference)s</string>
</dictionary>
</marshal>
"""
%
{
'computer_reference'
:
self
.
computer
.
getReference
()}
response
=
self
.
portal_slap
.
loadComputerConfigurationFromXML
(
computer_xml
)
self
.
assertEqual
(
'Content properly posted.'
,
response
)
self
.
assertLoadComputerConfigurationFromXML
(
({
'reference'
:
self
.
computer
.
getReference
()},),
{})
finally
:
if
os
.
path
.
exists
(
self
.
computer_load_configuration_simulator
):
os
.
unlink
(
self
.
computer_load_configuration_simulator
)
class
TestSlapOSSlapToolInstanceAccess
(
TestSlapOSSlapToolMixin
):
def
test_getComputerPartitionCertificate
(
self
):
self
.
_makeComplexComputer
()
...
...
master/bt5/slapos_slap_tool/bt/revision
View file @
fda45c50
11
\ No newline at end of file
12
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment