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
Nicolas Wavrant
slapos.core
Commits
bc91cc1f
Commit
bc91cc1f
authored
Jul 30, 2014
by
Alain Takoudjou
Committed by
Rafael Monnerat
Jul 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test getSoftwareReleaseListFromSoftwareProduct to include effective date
parent
80a4ad13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
3 deletions
+55
-3
master/bt5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
...5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
+54
-2
master/bt5/slapos_slap_tool/bt/revision
master/bt5/slapos_slap_tool/bt/revision
+1
-1
No files found.
master/bt5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
View file @
bc91cc1f
...
...
@@ -1691,11 +1691,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
assertTrue
(
software_release3
.
getValidationState
()
==
'released'
)
software_release1
.
edit
(
aggregate_value
=
software_product
.
getRelativeUrl
(),
url_string
=
'http://example.org/1.cfg'
url_string
=
'http://example.org/1.cfg'
,
effective_date
=
DateTime
()
)
software_release2
.
edit
(
aggregate_value
=
software_product
.
getRelativeUrl
(),
url_string
=
'http://example.org/2.cfg'
url_string
=
'http://example.org/2.cfg'
,
effective_date
=
DateTime
()
)
software_release3
.
edit
(
aggregate_value
=
software_product
.
getRelativeUrl
(),
...
...
@@ -1722,6 +1724,56 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
"""
%
(
software_release2
.
getUrlString
(),
software_release1
.
getUrlString
())
self
.
assertEqual
(
expected_xml
,
got_xml
,
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_getSoftwareReleaseListFromSoftwareProduct_effectiveDate
(
self
):
new_id
=
self
.
generateNewId
()
software_product
=
self
.
_makeSoftwareProduct
(
new_id
)
# 3 published software releases
software_release1
=
self
.
_makeSoftwareRelease
(
new_id
)
software_release2
=
self
.
_makeSoftwareRelease
(
self
.
generateNewId
())
software_release3
=
self
.
_makeSoftwareRelease
(
self
.
generateNewId
())
software_release1
.
publish
()
software_release2
.
publish
()
software_release3
.
publish
()
software_release1
.
edit
(
aggregate_value
=
software_product
.
getRelativeUrl
(),
url_string
=
'http://example.org/1.cfg'
,
effective_date
=
(
DateTime
()
-
1
)
)
# Should not be considered yet!
software_release2
.
edit
(
aggregate_value
=
software_product
.
getRelativeUrl
(),
url_string
=
'http://example.org/2.cfg'
,
effective_date
=
(
DateTime
()
+
1
)
)
software_release3
.
edit
(
aggregate_value
=
software_product
.
getRelativeUrl
(),
url_string
=
'http://example.org/3.cfg'
,
effective_date
=
DateTime
()
)
self
.
tic
()
response
=
self
.
portal_slap
.
getSoftwareReleaseListFromSoftwareProduct
(
software_product
.
getReference
())
# check returned XML
xml_fp
=
StringIO
.
StringIO
()
xml
.
dom
.
ext
.
PrettyPrint
(
xml
.
dom
.
ext
.
reader
.
Sax
.
FromXml
(
response
),
stream
=
xml_fp
)
xml_fp
.
seek
(
0
)
got_xml
=
xml_fp
.
read
()
expected_xml
=
"""
\
<?xml version='1.0' encoding='UTF-8'?>
<marshal>
<list id='i2'>
<string>%s</string>
<string>%s</string>
<string>%s</string>
</list>
</marshal>
"""
%
(
software_release3
.
getUrlString
(),
software_release1
.
getUrlString
(),
software_release2
.
getUrlString
())
self
.
assertEqual
(
expected_xml
,
got_xml
,
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_getSoftwareReleaseListFromSoftwareProduct_emptySoftwareProduct
(
self
):
new_id
=
self
.
generateNewId
()
...
...
master/bt5/slapos_slap_tool/bt/revision
View file @
bc91cc1f
34
\ No newline at end of file
35
\ No newline at end of file
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