mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
add tests for new callable list
This commit is contained in:
parent
5a785dd4ca
commit
db39040b31
1 changed files with 9 additions and 1 deletions
|
@ -10,7 +10,7 @@ from nose.tools import assert_equal, assert_true, assert_not_in
|
|||
|
||||
from xonsh import built_ins
|
||||
from xonsh.built_ins import reglob, regexpath, helper, superhelper, \
|
||||
ensure_list_of_strs
|
||||
ensure_list_of_strs, list_of_strs_or_callables
|
||||
from xonsh.environ import Env
|
||||
from xonsh.tools import ON_WINDOWS
|
||||
|
||||
|
@ -105,5 +105,13 @@ def test_ensure_list_of_strs():
|
|||
obs = ensure_list_of_strs(inp)
|
||||
yield assert_equal, exp, obs
|
||||
|
||||
def test_list_of_strs_or_callables():
|
||||
f = lambda x: 20
|
||||
cases = [(['yo'], 'yo'), (['yo'], ['yo']), (['42'], 42), (['42'], [42]),
|
||||
([f], f), ([f], [f])]
|
||||
for exp, inp in cases:
|
||||
obs = list_of_strs_or_callables(inp)
|
||||
yield assert_equal, exp, obs
|
||||
|
||||
if __name__ == '__main__':
|
||||
nose.runmodule()
|
||||
|
|
Loading…
Add table
Reference in a new issue