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
79439a13
Commit
79439a13
authored
Feb 08, 2023
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_slapproxy: Test request scope
parent
733b31a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
slapos/tests/test_slapproxy.py
slapos/tests/test_slapproxy.py
+12
-12
No files found.
slapos/tests/test_slapproxy.py
View file @
79439a13
...
...
@@ -563,16 +563,16 @@ class TestRequest(MasterMixin):
def
test_two_request_one_partition_free
(
self
):
"""
Since slapproxy
does not implement
scope, providing two partition_id
values will
still succeed, even if
only one partition is available.
Since slapproxy
implements
scope, providing two partition_id
values will
fail when
only one partition is available.
"""
self
.
format_for_number_of_partitions
(
1
)
self
.
assertIsInstance
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
),
slapos
.
slap
.
ComputerPartition
)
self
.
assertIsInstance
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart3'
)
,
slapos
.
slap
.
ComputerPartition
)
rv
=
self
.
_requestComputerPartition
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart3'
)
self
.
assertEqual
(
rv
.
_status_code
,
404
)
def
test_two_request_two_partition_free
(
self
):
"""
...
...
@@ -754,13 +754,13 @@ class TestRequest(MasterMixin):
def
test_two_different_request_from_two_partition
(
self
):
"""
Since slapproxy
does not
implement scope, two request with
different partition_id will
still return the same partition
.
Since slapproxy implement scope, two request with
different partition_id will
return different partitions
.
"""
self
.
format_for_number_of_partitions
(
2
)
self
.
assertEqual
(
dict
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
__dict__
,
_connection_helper
=
None
),
dict
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart3'
).
__dict__
,
_connection_helper
=
None
))
self
.
assert
Not
Equal
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
getId
(
),
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart3'
).
getId
(
))
def
test_two_different_request_from_one_partition
(
self
):
"""
...
...
@@ -769,8 +769,8 @@ class TestRequest(MasterMixin):
"""
self
.
format_for_number_of_partitions
(
2
)
self
.
assertNotEqual
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
__dict__
,
self
.
request
(
'http://sr//'
,
None
,
'frontend'
,
'slappart2'
).
__dict__
)
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
getId
()
,
self
.
request
(
'http://sr//'
,
None
,
'frontend'
,
'slappart2'
).
getId
()
)
def
test_request_with_nonascii_parameters
(
self
):
"""
...
...
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