forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request galaxyproject#16904 from jdavcs/dev_munge_lists_bug
Fix subtle bug in listify function + simplify list munging
- Loading branch information
Showing
5 changed files
with
49 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from galaxy.managers.base import combine_lists | ||
|
||
|
||
class NotFalsy: | ||
"""Class requires explicit check for None""" | ||
|
||
def __bool__(self): | ||
raise Exception("not implemented") | ||
|
||
|
||
def test_combine_lists(): | ||
foo, bar = NotFalsy(), NotFalsy() | ||
assert combine_lists(foo, None) == [foo] | ||
assert combine_lists(None, foo) == [foo] | ||
assert combine_lists(foo, bar) == [foo, bar] | ||
assert combine_lists([foo, bar], None) == [foo, bar] | ||
assert combine_lists(None, [foo, bar]) == [foo, bar] | ||
assert combine_lists(None, None) == [] |