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
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
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
Show 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):
...
@@ -563,16 +563,16 @@ class TestRequest(MasterMixin):
def
test_two_request_one_partition_free
(
self
):
def
test_two_request_one_partition_free
(
self
):
"""
"""
Since slapproxy
does not implement
scope, providing two partition_id
Since slapproxy
implements
scope, providing two partition_id
values will
still succeed, even if
only one partition is available.
values will
fail when
only one partition is available.
"""
"""
self
.
format_for_number_of_partitions
(
1
)
self
.
format_for_number_of_partitions
(
1
)
self
.
assertIsInstance
(
self
.
request
(
'http://sr//'
,
None
,
self
.
assertIsInstance
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
),
'MyFirstInstance'
,
'slappart2'
),
slapos
.
slap
.
ComputerPartition
)
slapos
.
slap
.
ComputerPartition
)
self
.
assertIsInstance
(
self
.
request
(
'http://sr//'
,
None
,
rv
=
self
.
_requestComputerPartition
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart3'
)
,
'MyFirstInstance'
,
'slappart3'
)
slapos
.
slap
.
ComputerPartition
)
self
.
assertEqual
(
rv
.
_status_code
,
404
)
def
test_two_request_two_partition_free
(
self
):
def
test_two_request_two_partition_free
(
self
):
"""
"""
...
@@ -754,13 +754,13 @@ class TestRequest(MasterMixin):
...
@@ -754,13 +754,13 @@ class TestRequest(MasterMixin):
def
test_two_different_request_from_two_partition
(
self
):
def
test_two_different_request_from_two_partition
(
self
):
"""
"""
Since slapproxy
does not
implement scope, two request with
Since slapproxy implement scope, two request with
different partition_id will
still return the same partition
.
different partition_id will
return different partitions
.
"""
"""
self
.
format_for_number_of_partitions
(
2
)
self
.
format_for_number_of_partitions
(
2
)
self
.
assertEqual
(
self
.
assert
Not
Equal
(
dict
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
__dict__
,
_connection_helper
=
None
),
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
getId
(
),
dict
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart3'
).
__dict__
,
_connection_helper
=
None
))
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart3'
).
getId
(
))
def
test_two_different_request_from_one_partition
(
self
):
def
test_two_different_request_from_one_partition
(
self
):
"""
"""
...
@@ -769,8 +769,8 @@ class TestRequest(MasterMixin):
...
@@ -769,8 +769,8 @@ class TestRequest(MasterMixin):
"""
"""
self
.
format_for_number_of_partitions
(
2
)
self
.
format_for_number_of_partitions
(
2
)
self
.
assertNotEqual
(
self
.
assertNotEqual
(
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
__dict__
,
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
).
getId
()
,
self
.
request
(
'http://sr//'
,
None
,
'frontend'
,
'slappart2'
).
__dict__
)
self
.
request
(
'http://sr//'
,
None
,
'frontend'
,
'slappart2'
).
getId
()
)
def
test_request_with_nonascii_parameters
(
self
):
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