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
Łukasz Nowak
slapos.core
Commits
054b2131
Commit
054b2131
authored
Apr 27, 2016
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapproxy: fix request test when software release url is modified
parent
b5fd5622
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
slapos/tests/slapproxy/__init__.py
slapos/tests/slapproxy/__init__.py
+41
-1
No files found.
slapos/tests/slapproxy/__init__.py
View file @
054b2131
...
...
@@ -420,7 +420,7 @@ class TestRequest(MasterMixin):
request1_dict
=
request1
.
__dict__
requested_result1
=
self
.
getPartitionInformation
(
request1_dict
[
'_partition_id'
])
request2
=
self
.
request
(
'http://sr
1
//'
,
'Papa'
,
'MyFirstInstance'
,
'slappart2'
,
request2
=
self
.
request
(
'http://sr//'
,
'Papa'
,
'MyFirstInstance'
,
'slappart2'
,
partition_parameter_kw
=
{
'domain'
:
wanted_domain2
})
request2_dict
=
request2
.
__dict__
requested_result2
=
self
.
getPartitionInformation
(
...
...
@@ -443,6 +443,46 @@ class TestRequest(MasterMixin):
self
.
assertEqual
(
wanted_domain2
,
requested_result2
.
_parameter_dict
[
'domain'
])
def
test_two_requests_with_different_parameters_and_sr_url_but_same_reference
(
self
):
"""
Request will return same partition for two different requests but will
only update parameters
"""
self
.
add_free_partition
(
2
)
wanted_domain1
=
'fou.org'
wanted_domain2
=
'carzy.org'
request1
=
self
.
request
(
'http://sr//'
,
None
,
'MyFirstInstance'
,
'slappart2'
,
partition_parameter_kw
=
{
'domain'
:
wanted_domain1
})
request1_dict
=
request1
.
__dict__
requested_result1
=
self
.
getPartitionInformation
(
request1_dict
[
'_partition_id'
])
request2
=
self
.
request
(
'http://sr1//'
,
'Papa'
,
'MyFirstInstance'
,
'slappart2'
,
partition_parameter_kw
=
{
'domain'
:
wanted_domain2
})
request2_dict
=
request2
.
__dict__
requested_result2
=
self
.
getPartitionInformation
(
request2_dict
[
'_partition_id'
])
# Test we received same partition
for
key
in
[
'_partition_id'
,
'_computer_id'
]:
self
.
assertEqual
(
request1_dict
[
key
],
request2_dict
[
key
])
# Test that parameters and software_release url changed
for
key
in
requested_result2
.
__dict__
:
if
key
not
in
[
'_parameter_dict'
,
'_software_release_document'
]:
self
.
assertEqual
(
requested_result2
.
__dict__
[
key
],
requested_result1
.
__dict__
[
key
])
elif
key
in
[
'_software_release_document'
]:
# software_release will be updated
self
.
assertEqual
(
requested_result2
.
__dict__
[
key
].
__dict__
[
'_software_release'
],
'http://sr1//'
)
self
.
assertEqual
(
requested_result1
.
__dict__
[
key
].
__dict__
[
'_software_release'
],
'http://sr//'
)
#Test parameters where set correctly
self
.
assertEqual
(
wanted_domain1
,
requested_result1
.
_parameter_dict
[
'domain'
])
self
.
assertEqual
(
wanted_domain2
,
requested_result2
.
_parameter_dict
[
'domain'
])
def
test_two_different_request_from_two_partition
(
self
):
"""
Since slapproxy does not implement scope, two request with
...
...
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