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
Ophélie Gagnard
slapos.core
Commits
5097e87c
Commit
5097e87c
authored
Sep 20, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests ensuring that safety checks for SLAP helpers is OK
parent
e0938d52
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
slapos/tests/slap.py
slapos/tests/slap.py
+66
-0
No files found.
slapos/tests/slap.py
View file @
5097e87c
...
@@ -219,6 +219,72 @@ class TestSlap(SlapMixin):
...
@@ -219,6 +219,72 @@ class TestSlap(SlapMixin):
self
.
assertRaises
(
slapos
.
slap
.
NotFoundError
,
self
.
assertRaises
(
slapos
.
slap
.
NotFoundError
,
self
.
slap
.
registerComputerPartition
,
computer_guid
,
partition_id
)
self
.
slap
.
registerComputerPartition
,
computer_guid
,
partition_id
)
def
test_getFullComputerInformation_empty_computer_guid
(
self
):
"""
Asserts that calling getFullComputerInformation with empty computer_id
raises early, before calling master.
"""
self
.
slap
.
initializeConnection
(
self
.
server_url
)
def
server_response
(
self_httpconnection
,
path
,
method
,
body
,
header
):
# Shouldn't even be called
self
.
assertFalse
(
True
)
httplib
.
HTTPConnection
.
_callback
=
server_response
self
.
assertRaises
(
slapos
.
slap
.
NotFoundError
,
self
.
slap
.
_connection_helper
.
getFullComputerInformation
,
None
)
def
test_registerComputerPartition_empty_computer_guid
(
self
):
"""
Asserts that calling registerComputerPartition with empty computer_id
raises early, before calling master.
"""
self
.
slap
.
initializeConnection
(
self
.
server_url
)
def
server_response
(
self_httpconnection
,
path
,
method
,
body
,
header
):
# Shouldn't even be called
self
.
assertFalse
(
True
)
httplib
.
HTTPConnection
.
_callback
=
server_response
self
.
assertRaises
(
slapos
.
slap
.
NotFoundError
,
self
.
slap
.
registerComputerPartition
,
None
,
'PARTITION_01'
)
def
test_registerComputerPartition_empty_computer_partition_id
(
self
):
"""
Asserts that calling registerComputerPartition with empty
computer_partition_id raises early, before calling master.
"""
self
.
slap
.
initializeConnection
(
self
.
server_url
)
def
server_response
(
self_httpconnection
,
path
,
method
,
body
,
header
):
# Shouldn't even be called
self
.
assertFalse
(
True
)
httplib
.
HTTPConnection
.
_callback
=
server_response
self
.
assertRaises
(
slapos
.
slap
.
NotFoundError
,
self
.
slap
.
registerComputerPartition
,
self
.
_getTestComputerId
(),
None
)
def
test_registerComputerPartition_empty_computer_guid_empty_computer_partition_id
(
self
):
"""
Asserts that calling registerComputerPartition with empty
computer_partition_id raises early, before calling master.
"""
self
.
slap
.
initializeConnection
(
self
.
server_url
)
def
server_response
(
self_httpconnection
,
path
,
method
,
body
,
header
):
# Shouldn't even be called
self
.
assertFalse
(
True
)
httplib
.
HTTPConnection
.
_callback
=
server_response
self
.
assertRaises
(
slapos
.
slap
.
NotFoundError
,
self
.
slap
.
registerComputerPartition
,
None
,
None
)
class
TestComputer
(
SlapMixin
):
class
TestComputer
(
SlapMixin
):
"""
"""
Tests slapos.slap.slap.Computer class functionality
Tests slapos.slap.slap.Computer class functionality
...
...
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