Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.toolbox
Commits
ad11ab67
Commit
ad11ab67
authored
Sep 15, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkfeedaspromise: do not fail if feed contains no item
parent
50948d5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
slapos/checkfeedaspromise.py
slapos/checkfeedaspromise.py
+3
-0
slapos/test/test_checkfeedaspromise.py
slapos/test/test_checkfeedaspromise.py
+8
-0
No files found.
slapos/checkfeedaspromise.py
View file @
ad11ab67
...
@@ -43,6 +43,9 @@ def checkFeedAsPromise(feed, option):
...
@@ -43,6 +43,9 @@ def checkFeedAsPromise(feed, option):
if
feed
.
bozo
:
if
feed
.
bozo
:
return
'Feed malformed'
return
'Feed malformed'
if
len
(
feed
.
entries
)
==
0
:
return
''
last_item
=
feed
.
entries
[
-
1
]
last_item
=
feed
.
entries
[
-
1
]
if
option
.
title
:
if
option
.
title
:
candidate_string
=
last_item
.
title
candidate_string
=
last_item
.
title
...
...
slapos/test/test_checkfeedaspromise.py
View file @
ad11ab67
...
@@ -118,5 +118,13 @@ class TestCheckFeedAsPromise(unittest.TestCase):
...
@@ -118,5 +118,13 @@ class TestCheckFeedAsPromise(unittest.TestCase):
self
.
assertNotEquals
(
len
(
checkFeedAsPromise
(
feed
,
option
)),
0
)
self
.
assertNotEquals
(
len
(
checkFeedAsPromise
(
feed
,
option
)),
0
)
def
test_noItemInTheFeedIsNotAnError
(
self
):
option
=
self
.
getOptionObject
()
option
.
title
=
True
feed
=
self
.
generateFeed
([])
self
.
assertEquals
(
checkFeedAsPromise
(
feed
,
option
),
""
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
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