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
Thomas Leymonerie
slapos.core
Commits
02a5857c
Commit
02a5857c
authored
Sep 13, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add httplib callback for TestComputer test
parent
bc8a3383
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
slapos/tests/slap.py
slapos/tests/slap.py
+24
-0
No files found.
slapos/tests/slap.py
View file @
02a5857c
...
@@ -233,6 +233,30 @@ class TestComputer(SlapMixin):
...
@@ -233,6 +233,30 @@ class TestComputer(SlapMixin):
computer_guid
=
self
.
_getTestComputerId
()
computer_guid
=
self
.
_getTestComputerId
()
slap
=
self
.
slap
slap
=
self
.
slap
slap
.
initializeConnection
(
self
.
server_url
)
slap
.
initializeConnection
(
self
.
server_url
)
partition_id
=
'PARTITION_01'
def
server_response
(
self
,
path
,
method
,
body
,
header
):
parsed_url
=
urlparse
.
urlparse
(
path
.
lstrip
(
'/'
))
parsed_qs
=
urlparse
.
parse_qs
(
parsed_url
.
query
)
if
parsed_url
.
path
==
'registerComputerPartition'
and
\
'computer_reference'
in
parsed_qs
and
\
'computer_partition_reference'
in
parsed_qs
:
slap_partition
=
slapos
.
slap
.
ComputerPartition
(
parsed_qs
[
'computer_reference'
][
0
],
parsed_qs
[
'computer_partition_reference'
][
0
])
return
(
200
,
{},
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_partition
))
elif
parsed_url
.
path
==
'getFullComputerInformation'
and
\
'computer_id'
in
parsed_qs
:
slap_computer
=
slapos
.
slap
.
Computer
(
parsed_qs
[
'computer_id'
][
0
])
slap_computer
.
_software_release_list
=
[]
slap_computer
.
_computer_partition_list
=
[]
return
(
200
,
{},
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_computer
))
elif
parsed_url
.
path
==
'requestComputerPartition'
:
return
(
408
,
{},
''
)
else
:
return
(
404
,
{},
''
)
httplib
.
HTTPConnection
.
_callback
=
server_response
computer
=
self
.
slap
.
registerComputer
(
computer_guid
)
computer
=
self
.
slap
.
registerComputer
(
computer_guid
)
self
.
assertEqual
(
computer
.
getComputerPartitionList
(),
[])
self
.
assertEqual
(
computer
.
getComputerPartitionList
(),
[])
...
...
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