xonsh/tests/lib/test_itertools.py
Andy Kipp 143042aff5
refactoring: create xonsh.api, update xonsh.lib (#5557)
To have clear `./xonsh` directory with the list of components we need to
move common packages that are not components of xonsh to lib directory.
cc #5538

I see that `lib.os` and `lib.subprocess` have a bit different intention.
I think more clearer will be put them to `xonsh.api`. This is the first
step to #5383.



## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-29 11:58:11 +02:00

13 lines
240 B
Python

from xonsh.lib.itertools import as_iterable
def test_single():
assert as_iterable(1) == (1,)
def test_list():
assert as_iterable([1, 2, 3]) == [1, 2, 3]
def test_string():
assert as_iterable("my string") == ("my string",)