# Path: nuka/tasks/shell.py
# class shell(Task):
#     """run a shell line (allow pipes)"""
# 
#     def __init__(self, cmd=None, **kwargs):
#         kwargs.setdefault('name', cmd)
#         super(shell, self).__init__(cmd=cmd, **kwargs)
# 
#     def do(self):
#         kwargs = {'shell': True}
#         watch = self.args.get('watch')
#         if watch:  # pragma: no cover
#             kwargs['watcher'] = utils.default_watcher(delay=watch)
#         cmd = self.args['cmd']
#         if isinstance(cmd, list):
#             cmd = ' '.join(cmd)
#         res = self.sh(cmd, **kwargs)
#         res.pop('stderr')
#         return res


from nuka.tasks import shell
import pytest
# -*- coding: utf-8 -*-


@pytest.mark.asyncio
async def test_sh(host):
    assert (await shell.shell('ls / | grep etc'))


@pytest.mark.asyncio
async def test_command(host):

# Path: nuka/tasks/shell.py
# class shell(Task):
#     """run a shell line (allow pipes)"""
# 
#     def __init__(self, cmd=None, **kwargs):
#         kwargs.setdefault('name', cmd)
#         super(shell, self).__init__(cmd=cmd, **kwargs)
# 
#     def do(self):
#         kwargs = {'shell': True}
#         watch = self.args.get('watch')
#         if watch:  # pragma: no cover
#             kwargs['watcher'] = utils.default_watcher(delay=watch)
#         cmd = self.args['cmd']
#         if isinstance(cmd, list):
#             cmd = ' '.join(cmd)
#         res = self.sh(cmd, **kwargs)
#         res.pop('stderr')
#         return res


# Path: tests/tasks/test_shell.py
from nuka.tasks import shell
import pytest

# -*- coding: utf-8 -*-


@pytest.mark.asyncio
async def test_sh(host):
    assert (await shell.shell('ls / | grep etc'))


@pytest.mark.asyncio
async def test_command(host):

    assert (await shell.command(['ls', '/']))